Re: [PATCH 1/4] mm/gup_benchmark: Take the mmap lock around GUP
From: Jason Gunthorpe
Date: Wed Sep 30 2020 - 08:20:18 EST
On Tue, Sep 29, 2020 at 06:19:59PM -0700, Jann Horn wrote:
> To be safe against concurrent changes to the VMA tree, we must take the
> mmap lock around GUP operations (excluding the GUP-fast family of
> operations, which will take the mmap lock by themselves if necessary).
>
> This code is only for testing, and it's only reachable by root through
> debugfs, so this doesn't really have any impact; however, if we want to add
> lockdep asserts into the GUP path, we need to have clean locking here.
>
> Signed-off-by: Jann Horn <jannh@xxxxxxxxxx>
> ---
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Jason