Re: [PATCH v3 07/10] mmap locking API: add mmap_read_release() and mmap_read_unlock_non_owner()

Michel Lespinasse
2020-04-06T15:40:09Z

On Wed, Apr 1, 2020 at 6:46 AM Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Mar 27, 2020 at 03:50:59PM -0700, Michel Lespinasse wrote:
> > Add a couple APIs to allow splitting mmap_read_unlock() into two calls:
> > - mmap_read_release(), called by the task that had taken the mmap lock;
> > - mmap_read_unlock_non_owner(), called from a work queue.
> >
> > These apis are used by kernel/bpf/stackmap.c only.
>
> That code is an absolute abomination and should never have gotten
> merged.

I have to say, it's causing me some grief too :/

> That said; I would prefer a mmap_read_trylock_nonowner() over
> mmap_read_release() existing.

It only addresses part of the issue, but I suppose I could do that. Is
this something I could append to the end of this series, or do I need
to prepare a v4 for such changes ?