Re: [PATCH 1/2] nfsd: protect concurrent access to nfsd stats counters

Chuck Lever
2020-12-28T23:14:54Z

Hello Amir -

> On Dec 28, 2020, at 12:03 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>
> nfsd stats counters can be updated by concurrent nfsd threads without any
> protection.
>
> Convert some nfsd_stats and nfsd_net struct members to use percpu counters.
>
> There are several members of struct nfsd_stats that are reported in file
> /proc/net/rpc/nfsd by never updated. Those have been left untouched.
>
> The longest_chain* members of struct nfsd_net remain unprotected.

I like the idea of converting these to per-CPU variables, and the
use of standards kernel helpers is clean. I haven't looked closely
at the NFSD-specific parts of 1/2 yet.

Looking forward to Bruce and Jeff's commentary.

--
Chuck Lever