(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

arm64: clear_page[s] using memset

There is no need to try to second-guess the compiler when clearing memory. Just call memset() like everyone else. Since memset() already has an architecture-local MOPS optimization, we do not need to do anything else to preserve the MOPS optimization. While at it, implement the shorthand for directly calling the new prototype clear_pages() for larger page chunks. No performance regressions can be seen, the fastpath benchmarks differences are in the noise. Usama Anjum tested next-20260821 with one warm-up and three repeats in four sessions, for a total of 12 measured runs. The commands were: perf bench mem memset -k 1GB -f default -s 16GB perf bench mem mmap -p 1GB -f demand -s 32GB -l 5 perf bench mem mmap -p 4KB -f demand -s 32GB -l 5 The results were: aws-m7g.metal: Benchmark Base bytes/sec Change with patch memset 1GB 63932542232.12 1.92% mmap 1GB 63272579168.03 -0.57% mmap 4KB 49692830849.48 -1.11% cesw-aarch64-ampereone-1s-a192-32x: Benchmark Base bytes/sec Change with patch memset 1GB 33895562998.71 0.25% mmap 1GB 34338454210.17 1.16% mmap 4KB 25687107580.90 -0.85% Assisted-by: LLM Suggested-by: Will Deacon <will@kernel.org> Tested-by: Usama Anjum <usama.anjum@arm.com> Link: https://lore.kernel.org/linux-arm-kernel/20260303-aarch64-clear-pages-v1-1-ad0c3ee9a555@kernel.org/ Link: https://lore.kernel.org/linux-arm-kernel/67ab6c51-4511-46ab-931b-a4323551147a@arm.com/ Signed-off-by: Linus Walleij <linusw@kernel.org> Reviewed-by: Leonardo Bras <leo.bras@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>


Author Linus Walleij Committer Catalin Marinas Date Commit Parent d6ae12c9
+14 -57
5 changed files
+14 -57
5 changed files