[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210801123335.6a7f8e1ee1e52ea64db80323@linux-foundation.org>
Date: Sun, 1 Aug 2021 12:33:35 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Luigi Rizzo <lrizzo@...gle.com>
Cc: linux-kernel@...r.kernel.org, David Rientjes <rientjes@...gle.com>,
linux-mm@...ck.org
Subject: Re: [PATCH] Add mmap_assert_locked() annotations to find_vma*()
On Sat, 31 Jul 2021 10:53:41 -0700 Luigi Rizzo <lrizzo@...gle.com> wrote:
> find_vma() and variants need protection when used.
> This patch adds mmap_assert_lock() calls in the functions.
>
> To make sure the invariant is satisfied, we also need to add a
> mmap_read_loc() around the get_user_pages_remote() call in
> get_arg_page(). The lock is not strictly necessary because the mm
> has been newly created, but the extra cost is limited because
> the same mutex was also acquired shortly before in __bprm_mm_init(),
> so it is hot and uncontended.
>
Well, it isn't cost-free. find_vma() is called a lot and a surprising
number of systems apparently run with CONFIG_DEBUG_VM. Why do you
think this cost is justified?
Powered by blists - more mailing lists