Re: [PATCH resend v5 02/11] ceph: add caps perf metric for each session

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

 



On 2020/2/5 5:10, Jeff Layton wrote:
On Fri, 2020-01-31 at 17:02 +0800, Xiubo Li wrote:
On 2020/1/31 9:34, Xiubo Li wrote:
On 2020/1/31 3:00, Jeffrey Layton wrote:

[...]
Currently in fuse client, for each inode it is its auth_cap->session's
responsibility to do all the cap hit/mis counting if it has a auth_cap,
or choose any one exist.

Maybe this is one acceptable approach.
Again, it's not clear to me what you're trying to measure.

Typically, when you're counting hits and misses on a cache, what you
care about is whether you had to wait to fill the cache in order to
proceed. That means a lookup in the case of the dcache, but for this
it's a cap request. If we have a miss, then we're going to ask a single
MDS to resolve it.

To me, it doesn't really make a lot of sense to track this at the
session level since the client deals with cap hits and misses as a union
of the caps for each session. Keeping per-superblock stats makes a lot
more sense in my opinion.

That makes this easy to determine too. You just logically OR all of the
"issued" masks together (and maybe the implemented masks in requests
that allow that), and check whether that covers the mask you need. If it
does, then you have a hit, if not, a miss.

So, to be clear, what we'd be measuring in that case is cap cache checks
per superblock. Is that what you're looking to measure with this?

The following is the new approach:

 65 +/*
 66 + * Counts the cap metric.
 67 + *
 68 + * This will try to traverse all the ci->i_caps, if we can
 69 + * get all the cap 'mask' it will count the hit, or the mis.
 70 + */
 71 +void __ceph_caps_metric(struct ceph_inode_info *ci, int mask)
 72 +{
 73 +       struct ceph_mds_client *mdsc =
 74 + ceph_sb_to_client(ci->vfs_inode.i_sb)->mdsc;
 75 +       struct ceph_client_metric *metric = &mdsc->metric;
 76 +       int issued;
 77 +
 78 +       lockdep_assert_held(&ci->i_ceph_lock);
 79 +
 80 +       if (mask <= 0)
 81 +               return;
 82 +
 83 +       issued = __ceph_caps_issued(ci, NULL);
 84 +
 85 +       if ((mask & issued) == mask)
 86 + percpu_counter_inc(&metric->i_caps_hit);
 87 +       else
 88 + percpu_counter_inc(&metric->i_caps_mis);
 89 +}
 90 +

The cap hit/mis metric are per-superblock, just like the others.

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