Re: [PATCH v2 1/8] ceph: add global dentry lease metric support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020/1/9 21:52, Jeff Layton wrote:
On Wed, 2020-01-08 at 05:41 -0500, xiubli@xxxxxxxxxx wrote:
[...]
@@ -1589,13 +1595,14 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
  		}
  	}
+ mdsc = ceph_sb_to_client(dir->i_sb)->mdsc;
  	if (!valid) {
-		struct ceph_mds_client *mdsc =
-			ceph_sb_to_client(dir->i_sb)->mdsc;
  		struct ceph_mds_request *req;
  		int op, err;
  		u32 mask;
+ percpu_counter_inc(&mdsc->metric.d_lease_mis);
+
  		if (flags & LOOKUP_RCU)
  			return -ECHILD;
So suppose we're doing an RCU walk, and call d_revalidate and the dentry
is invalid. We'll bump the counter here, but then return -ECHILD and the
kernel will do the d_revalidate all over again with refwalk, and we bump
the counter again.

Won't that end up double-counting the cache miss? Or is that intended
here?

Yeah, we should count it once. Will fix it in the next version.

Thanks,




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux