On 2020/8/19 4:10, Patrick Donnelly wrote:
On Tue, Aug 18, 2020 at 1:05 PM Jeff Layton <jlayton@xxxxxxxxxx> wrote:
Bear in mind that if the same file has been opened several times, then
you'll get an increment for each.
Having an open file count (even for the same inode) and a count of
inodes opened sounds useful to me. The latter would require some kind
of refcounting for each inode? Maybe that's too expensive though.
For the second, yes, we need one percpu refcount, which can be add in
ceph_get_fmode() when increasing any entry of the
ci->i_nr_by_mode[fmode] for the first time, to decrease it in
ceph_put_fmode() when the ci->i_nr_by_mode[fmode] is empty. IMO, it
should be okay and won't cost too much.
Thanks
BRs
Would it potentially be more useful to report the number of inodes that
have open file descriptions associated with them? It's hard for me to
know as I'm not clear on the intended use-case for this.
Use-case is more information available via `fs top`.