[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231204213943.GB4129@monkey>
Date: Mon, 4 Dec 2023 13:39:43 -0800
From: Mike Kravetz <mike.kravetz@...cle.com>
To: Muchun Song <songmuchun@...edance.com>
Cc: Steven Price <steven.price@....com>, Jann Horn <jannh@...gle.com>,
muchun.song@...ux.dev, akpm@...ux-foundation.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] mm: pagewalk: assert write mmap lock only for
walking the user page tables
On 11/27/23 16:46, Muchun Song wrote:
> The 8782fb61cc848 ("mm: pagewalk: Fix race between unmap and page walker")
> introduces an assertion to walk_page_range_novma() to make all the users
> of page table walker is safe. However, the race only exists for walking the
> user page tables. And it is ridiculous to hold a particular user mmap write
> lock against the changes of the kernel page tables. So only assert at least
> mmap read lock when walking the kernel page tables. And some users matching
> this case could downgrade to a mmap read lock to relief the contention of
> mmap lock of init_mm, it will be nicer in hugetlb (only holding mmap read
> lock) in the next patch.
At first, I did not understand your motivation for this patch. But, it
makes sense as your next patch will replace hugetlb vmemmap specific walk
routines with walk_page_range_novma.
Directly Cc'ing Steven and Jann in case they have comments.
>
> Signed-off-by: Muchun Song <songmuchun@...edance.com>
> ---
> mm/pagewalk.c | 29 ++++++++++++++++++++++++++++-
> 1 file changed, 28 insertions(+), 1 deletion(-)
Looks fine to me,
Acked-by: Mike Kravetz <mike.kravetz@...cle.com>
--
Mike Kravetz
Powered by blists - more mailing lists