From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Ankur Arora <ankur.a.arora@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
mingo@redhat.com, mjguzik@gmail.com, luto@kernel.org,
peterz@infradead.org, acme@kernel.org, namhyung@kernel.org,
tglx@linutronix.de, willy@infradead.org, raghavendra.kt@amd.com,
boris.ostrovsky@oracle.com, konrad.wilk@oracle.com
Subject: Re: [PATCH v8 0/7] mm: folio_zero_user: clear contiguous pages
Date: Fri, 7 Nov 2025 09:59:35 +0100 [thread overview]
Message-ID: <52f67ca1-24c6-4081-99e6-0a1d30da1bd6@kernel.org> (raw)
In-Reply-To: <87h5v676f4.fsf@oracle.com>
On 07.11.25 06:33, Ankur Arora wrote:
>
> Ankur Arora <ankur.a.arora@oracle.com> writes:
>
>> [ My earlier reply to this ate up some of the headers and broke out of
>> the thread. Resending. ]
>>
>> Andrew Morton <akpm@linux-foundation.org> writes:
>>
>>> On Mon, 27 Oct 2025 13:21:02 -0700 Ankur Arora <ankur.a.arora@oracle.com> wrote:
>>>
>
> [ ... ]
>
>>
>>> It's possible that we're being excessively aggressive with those
>>> cond_resched()s. Have you investigating tuning their frequency so we
>>> can use larger extent sizes with these preemption models?
>>
>>
>> folio_zero_user() does a small part of that: for 2MB pages the clearing
>> is split in three parts with an intervening cond_resched() for each.
>>
>> This is of course much simpler than the process_huge_page() approach where
>> we do a left right dance around the faulting page.
>>
>> I had implemented a version of process_huge_page() with larger extent
>> sizes that narrowed as we got closer to the faulting page in [a] (x86
>> performance was similar to the current series. See [b]).
>>
>> In hindsight however, that felt too elaborate and probably unnecessary
>> on most modern systems where you have reasonably large caches.
>> Where it might help, however, is on more cache constrained systems where
>> the spatial locality really does matter.
>>
>> So, my idea was to start with a simple version, get some testing and
>> then fill in the gaps instead of starting with something like [a].
>>
>>
>> [a] https://lore.kernel.org/lkml/20220606203725.1313715-1-ankur.a.arora@oracle.com/#r
>> [b] https://lore.kernel.org/lkml/20220606202109.1306034-1-ankur.a.arora@oracle.com/
>>
>>>> The anon-w-seq test in the vm-scalability benchmark, however, does show
>>>> worse performance with utime increasing by ~9%:
>>>>
>>>> stime utime
>>>>
>>>> baseline 1654.63 ( +- 3.84% ) 811.00 ( +- 3.84% )
>>>> +series 1630.32 ( +- 2.73% ) 886.37 ( +- 5.19% )
>>>>
>>>> In part this is because anon-w-seq runs with 384 processes zeroing
>>>> anonymously mapped memory which they then access sequentially. As
>>>> such this is a likely uncommon pattern where the memory bandwidth
>>>> is saturated while also being cache limited because we access the
>>>> entire region.
>>>>
>>>> Raghavendra also tested previous version of the series on AMD Genoa [1].
>>>
>>> I suggest you paste Raghavendra's results into this [0/N] - it's
>>> important material.
>>
>> Thanks. Will do.
>>
>>>>
>>>> ...
>>>>
>>>> arch/alpha/include/asm/page.h | 1 -
>>>> arch/arc/include/asm/page.h | 2 +
>>>> arch/arm/include/asm/page-nommu.h | 1 -
>>>> arch/arm64/include/asm/page.h | 1 -
>>>> arch/csky/abiv1/inc/abi/page.h | 1 +
>>>> arch/csky/abiv2/inc/abi/page.h | 7 ---
>>>> arch/hexagon/include/asm/page.h | 1 -
>>>> arch/loongarch/include/asm/page.h | 1 -
>>>> arch/m68k/include/asm/page_mm.h | 1 +
>>>> arch/m68k/include/asm/page_no.h | 1 -
>>>> arch/microblaze/include/asm/page.h | 1 -
>>>> arch/mips/include/asm/page.h | 1 +
>>>> arch/nios2/include/asm/page.h | 1 +
>>>> arch/openrisc/include/asm/page.h | 1 -
>>>> arch/parisc/include/asm/page.h | 1 -
>>>> arch/powerpc/include/asm/page.h | 1 +
>>>> arch/riscv/include/asm/page.h | 1 -
>>>> arch/s390/include/asm/page.h | 1 -
>>>> arch/sparc/include/asm/page_32.h | 2 +
>>>> arch/sparc/include/asm/page_64.h | 1 +
>>>> arch/um/include/asm/page.h | 1 -
>>>> arch/x86/include/asm/page.h | 6 ---
>>>> arch/x86/include/asm/page_32.h | 6 +++
>>>> arch/x86/include/asm/page_64.h | 64 ++++++++++++++++++-----
>>>> arch/x86/lib/clear_page_64.S | 39 +++-----------
>>>> arch/xtensa/include/asm/page.h | 1 -
>>>> include/linux/highmem.h | 29 +++++++++++
>>>> include/linux/mm.h | 69 +++++++++++++++++++++++++
>>>> mm/memory.c | 82 ++++++++++++++++++++++--------
>>>> mm/util.c | 13 +++++
>>>> 30 files changed, 247 insertions(+), 91 deletions(-)
>>>
>>> I guess this is an mm.git thing, with x86 acks (please).
>>
>> Ack that.
>>
>>> The documented review activity is rather thin at this time so I'll sit
>>> this out for a while. Please ping me next week and we can reassess,
>>
>> Will do. And, thanks for the quick look!
>
> Hi Andrew
>
> So, the comments I have so far are mostly about clarity around the
> connection with preempt model and some cleanups on the x86 patches.
>
> Other than that, my major concern is wider testing (platforms and
> workloads) than mine has been.
>
> Could you take another look at the series and see what else you think
> it needs.
Sorry for the delay from my side, I took another look at patches and had
some smaller comments.
--
Cheers
David
next prev parent reply other threads:[~2025-11-07 8:59 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 20:21 [PATCH v8 0/7] mm: folio_zero_user: clear contiguous pages Ankur Arora
2025-10-27 20:21 ` [PATCH v8 1/7] treewide: provide a generic clear_user_page() variant Ankur Arora
2025-10-27 20:21 ` [PATCH v8 2/7] mm: introduce clear_pages() and clear_user_pages() Ankur Arora
2025-11-07 8:47 ` David Hildenbrand (Red Hat)
2025-10-27 20:21 ` [PATCH v8 3/7] mm/highmem: introduce clear_user_highpages() Ankur Arora
2025-11-07 8:48 ` David Hildenbrand (Red Hat)
2025-11-10 7:20 ` Ankur Arora
2025-10-27 20:21 ` [PATCH v8 4/7] x86/mm: Simplify clear_page_* Ankur Arora
2025-10-28 13:36 ` Borislav Petkov
2025-10-29 23:26 ` Ankur Arora
2025-10-30 0:17 ` Borislav Petkov
2025-10-30 5:21 ` Ankur Arora
2025-10-27 20:21 ` [PATCH v8 5/7] x86/clear_page: Introduce clear_pages() Ankur Arora
2025-10-28 13:56 ` Borislav Petkov
2025-10-28 18:51 ` Ankur Arora
2025-10-29 22:57 ` Borislav Petkov
2025-10-29 23:31 ` Ankur Arora
2025-10-27 20:21 ` [PATCH v8 6/7] mm, folio_zero_user: support clearing page ranges Ankur Arora
2025-11-07 8:59 ` David Hildenbrand (Red Hat)
2025-11-10 7:20 ` Ankur Arora
2025-11-10 8:57 ` David Hildenbrand (Red Hat)
2025-11-11 6:24 ` Ankur Arora
2025-10-27 20:21 ` [PATCH v8 7/7] mm: folio_zero_user: cache neighbouring pages Ankur Arora
2025-10-27 21:33 ` [PATCH v8 0/7] mm: folio_zero_user: clear contiguous pages Andrew Morton
2025-10-28 17:22 ` Ankur Arora
2025-11-07 5:33 ` Ankur Arora
2025-11-07 8:59 ` David Hildenbrand (Red Hat) [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-10-28 17:15 Ankur Arora
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=52f67ca1-24c6-4081-99e6-0a1d30da1bd6@kernel.org \
--to=david@kernel.org \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ankur.a.arora@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=mjguzik@gmail.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=raghavendra.kt@amd.com \
--cc=tglx@linutronix.de \
--cc=willy@infradead.org \
--cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).