答复: [外部邮件] Re: [PATCH] fs: Make file-nr output the total allocated file handles

From: Li,Rongqing
Date: Sat Apr 12 2025 - 09:00:31 EST



> On Thu, Apr 10, 2025 at 07:21:17PM +0800, lirongqing wrote:
> > From: Li RongQing <lirongqing@xxxxxxxxx>
> >
> > Make file-nr output the total allocated file handles, not per-cpu
> > cache number, it's more precise, and not in hot path
> >
> > Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>
> > ---
>
> That means grabbing a lock suddenly. Is there an actual use-case behind this?

want to monitor it to find the leaking of the allocated file handler by some applications, but find it is inaccurate

So I think this is not a hot path, percpu_counter_sum_positive may be able to be used

Thank
-Li