From: Alistair Popple <apopple@nvidia.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: "Michal Hocko" <mhocko@suse.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-s390@vger.kernel.org, netdev@vger.kernel.org,
"David Hildenbrand" <david@redhat.com>,
"Peter Xu" <peterx@redhat.com>,
"Nadav Amit" <nadav.amit@gmail.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Vlastimil Babka" <vbabka@suse.cz>,
"Rik van Riel" <riel@surriel.com>,
"Will Deacon" <will@kernel.org>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Christian Brauner" <brauner@kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [RFC PATCH] mm: remove zap_page_range and change callers to use zap_vma_page_range
Date: Thu, 05 Jan 2023 12:14:36 +1100 [thread overview]
Message-ID: <87bkndvks7.fsf@nvidia.com> (raw)
In-Reply-To: <Y6C6B08nTWusK3RI@monkey>
Mike Kravetz <mike.kravetz@oracle.com> writes:
> On 12/19/22 13:06, Michal Hocko wrote:
>> On Fri 16-12-22 11:20:12, Mike Kravetz wrote:
>> > zap_page_range was originally designed to unmap pages within an address
>> > range that could span multiple vmas. While working on [1], it was
>> > discovered that all callers of zap_page_range pass a range entirely within
>> > a single vma. In addition, the mmu notification call within zap_page
>> > range does not correctly handle ranges that span multiple vmas as calls
>> > should be vma specific.
>>
>> Could you spend a sentence or two explaining what is wrong here?
>
> Hmmmm? My assumption was that the range passed to mmu_notifier_range_init()
> was supposed to be within the specified vma. When looking into the notifier
> routines, I could not find any documentation about the usage of the vma within
> the mmu_notifier_range structure. It was introduced with commit bf198b2b34bf
> "mm/mmu_notifier: pass down vma and reasons why mmu notifier is happening".
> However, I do not see this being used today.
>
> Of course, I could be missing something, so adding Jérôme.
The only use for mmu_notifier_range->vma I can find is in
mmu_notifier_range_update_to_read_only() which was introduced in
c6d23413f81b ("mm/mmu_notifier: mmu_notifier_range_update_to_read_only()
helper"). However there are no users of that symbol so I think we can
remove it along with the mmu_notifier_range->vma field.
I will put togeather a patch to do that.
>>
>> > Instead of fixing zap_page_range, change all callers to use the new
>> > routine zap_vma_page_range. zap_vma_page_range is just a wrapper around
>> > zap_page_range_single passing in NULL zap details. The name is also
>> > more in line with other exported routines that operate within a vma.
>> > We can then remove zap_page_range.
>>
>> I would stick with zap_page_range_single rather than adding a new
>> wrapper but nothing really critical.
>
> I am fine with doing that as well. My only reason for the wrapper is that all
> callers outside mm/memory.c would pass in NULL zap details.
>
>>
>> > Also, change madvise_dontneed_single_vma to use this new routine.
>> >
>> > [1] https://lore.kernel.org/linux-mm/20221114235507.294320-2-mike.kravetz@oracle.com/
>> > Suggested-by: Peter Xu <peterx@redhat.com>
>> > Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
>>
>> Other than that LGTM
>> Acked-by: Michal Hocko <mhocko@suse.com>
>>
>> Thanks!
>
> Thanks for taking a look.
next prev parent reply other threads:[~2023-01-05 1:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 19:20 Mike Kravetz
2022-12-19 12:06 ` Michal Hocko
2022-12-19 19:22 ` Mike Kravetz
2023-01-05 1:14 ` Alistair Popple [this message]
2022-12-20 17:38 ` Peter Xu
2022-12-21 3:15 ` Michael Ellerman
2022-12-23 16:27 ` Christoph Hellwig
2022-12-23 21:22 ` Mike Kravetz
2022-12-29 16:22 ` Palmer Dabbelt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkndvks7.fsf@nvidia.com \
--to=apopple@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=borntraeger@linux.ibm.com \
--cc=brauner@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=edumazet@google.com \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=mpe@ellerman.id.au \
--cc=nadav.amit@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=palmer@dabbelt.com \
--cc=peterx@redhat.com \
--cc=riel@surriel.com \
--cc=vbabka@suse.cz \
--cc=will@kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox