Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Usama Anjum <usama.anjum@arm.com>
To: Linus Walleij <linusw@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Ryan Roberts <ryan.roberts@arm.com>
Cc: usama.anjum@arm.com, Will Deacon <will@kernel.org>,
	Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Subject: Re: [PATCH] arm64: clear_page[s] using memset
Date: Mon, 24 Aug 2026 14:38:18 +0100	[thread overview]
Message-ID: <67ab6c51-4511-46ab-931b-a4323551147a@arm.com> (raw)
In-Reply-To: <CAD++jLmMxj1C7sGz-Yt8Y+NC1CbrUTTSH4QvcZfYuJAcNoYYCQ@mail.gmail.com>

On 08/04/2026 8:47 am, Linus Walleij wrote:
> On Tue, Apr 7, 2026 at 3:47 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>> On Tue, Apr 07, 2026 at 11:25:55AM +0200, Linus Walleij wrote:
>>> Quoting my own commit message hehe:
>>>
>>>> No performance regressions can be seen, the fastpath
>>>> benchmarks differences are in the noise.
>>>
>>> This was tested on hardware with Ryan Robert's fastpath tool.
>>
>> BTW, have you tried the perf bench mmap test again with the new
>> clear_page? Both with single page and multiple pages scenarios. And
>> ideally on more than one platform.
>>
>> Will pointed out (in a private chat) that current clear_page() uses
>> non-temporal stores while memset() doesn't. It may not make any
>> difference in practice but it would be good to have some numbers.
> 
> Hm interesting point, the perf bench mmap test isn't specifically
> in fastpath but since it tends to come up I guess we can add it?
> 
> Ryan: is it easy to add this test to fastpath? Or easy for me to do
> myself? I looked at the instructions but they were a bit intimidating...
> 
> The test is the following:
> 
>     We boot the kernel with cmdline like this:
>     "default_hugepagesz=1G hugepagesz=1G hugepages=32" to make sure
>     we have ample hugepages. This was then tested with the same
>     cmdline as the original series:
> 
>     perf bench mem mmap -p 1GB -f demand -s 32GB -l 5
> 
>     The first run was discarded as the memory hierarchy is cold on
>     the first run. Then I ran the above command 5 times and averaged
>     the throughput

I've ran tests for with 1 warmup and 3 repeats in 4 sessions (12 times). 

Results for SUT Class aws-m7g.metal:
╭─────────────┬────────────────────────────────────────────────┬───────────────────────────────────────────────┬───────────────────────────────────────────╮
│ Benchmark   │ Result Class                                   │   next-20260821 without this patch (base)     │   next-20260821 with this patch           │
├─────────────┼────────────────────────────────────────────────┼───────────────────────────────────────────────┼───────────────────────────────────────────┤
│ perf/mem    │ memset -k 1GB -f default -s 16GB (bytes/sec)   │                                63932542232.12 │                                     1.92% │
│             │ mmap -p 1GB -f demand -s 32GB -l 5 (bytes/sec) │                                63272579168.03 │                                    -0.57% │
│             │ mmap -p 4KB -f demand -s 32GB -l 5 (bytes/sec) │                                49692830849.48 │                                    -1.11% │
╰─────────────┴────────────────────────────────────────────────┴───────────────────────────────────────────────┴───────────────────────────────────────────╯

Results for SUT Class cesw-aarch64-ampereone-1s-a192-32x:
╭─────────────┬────────────────────────────────────────────────┬───────────────────────────────────────────────┬───────────────────────────────────────────╮
│ Benchmark   │ Result Class                                   │   next-20260821 without this patch (base)     │   next-20260821 with this patch           │
├─────────────┼────────────────────────────────────────────────┼───────────────────────────────────────────────┼───────────────────────────────────────────┤
│ perf/mem    │ memset -k 1GB -f default -s 16GB (bytes/sec)   │                                33895562998.71 │                                     0.25% │
│             │ mmap -p 1GB -f demand -s 32GB -l 5 (bytes/sec) │                                34338454210.17 │                                     1.16% │
│             │ mmap -p 4KB -f demand -s 32GB -l 5 (bytes/sec) │                                25687107580.90 │                                    -0.85% │
╰─────────────┴────────────────────────────────────────────────┴───────────────────────────────────────────────┴───────────────────────────────────────────╯


> 
> The x86 commit cb431accb36e51b64ce34b5cc4d5ed292895fd84
> also mentions this test:
> 
> perf bench mem memset -k 1GB -f default -s 16GB
> 
> I tried it on QEMU, no real benefits with either the previous or this
> patch, and no regressions either. (x86 passes -f x86-64-stosq
> which are some optimized memset instructions)
> 
> Yours,
> Linus Walleij
> 

Thanks,
Usama



  reply	other threads:[~2026-08-24 13:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  8:57 [PATCH] arm64: clear_page[s] using memset Linus Walleij
2026-04-02 20:57 ` Catalin Marinas
2026-04-07  9:25   ` Linus Walleij
2026-04-07  9:42     ` Catalin Marinas
2026-04-07 13:47     ` Catalin Marinas
2026-04-08  7:47       ` Linus Walleij
2026-08-24 13:38         ` Usama Anjum [this message]
2026-08-26 11:50           ` Linus Walleij

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=67ab6c51-4511-46ab-931b-a4323551147a@arm.com \
    --to=usama.anjum@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /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