Re: [PATCH] rlimits: do not grab tasklist_lock for do_prlimit on current

From: Cyrill Gorcunov
Date: Sun Dec 19 2021 - 16:30:16 EST


On Wed, Dec 15, 2021 at 01:42:32PM -0600, Eric W. Biederman wrote:
...
>
> > If it's too much of a risk/ugliness for not clear enough gain (in code
> > quality or performance), I'm fine with dropping it.
>
> Removing the tasklist_lock where we can is definitely a clear gain.
>
> Simply shoving tasklist_lock aside and making the code more complicated
> is much less clear.
>
> Plus anything you can benchmark (even microbenchmark) and show the
> benefit of is welcome. Especially when you have indications that it
> makes a difference in a larger context.

Thanks for looking into this, Eric! I must confess I've a vague memory
about this code. Still while you're talking about cleanup I wonder if
we should make do_prlimit() being a static function, not global as it
now.