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,