Re: [PATCH 0/6] convert locked_vm from unsigned long to atomic64_t

From: Daniel Jordan
Date: Wed Apr 03 2019 - 12:53:05 EST

On Wed, Apr 03, 2019 at 08:51:13AM -0400, Steven Sistare wrote:
> On 4/2/2019 4:41 PM, Daniel Jordan wrote:
> > [1]
> You could clean all 6 patches up nicely with a common subroutine that
> increases locked_vm subject to the rlimit. Pass a bool arg that is true if
> the limit should be enforced, !dma->lock_cap for one call site, and
> !capable(CAP_IPC_LOCK) for the rest. Push the warnings and debug statements
> to the subroutine as well. One patch could refactor, and a second could
> change the locking method.

Yes, I tried writing, but didn't end up including, such a subroutine for [1].
The devil was in the details, but with the cmpxchg business, it's more
worthwhile to iron all those out. I'll give it a try.