[PATCH] arm64: clear_page[s] using memset

Catalin Marinas catalin.marinas at arm.com
Tue Apr 7 02:42:00 PDT 2026


On Tue, Apr 07, 2026 at 11:25:55AM +0200, Linus Walleij wrote:
> On Thu, Apr 2, 2026 at 10:57 PM Catalin Marinas <catalin.marinas at arm.com> wrote:
> > On Fri, Mar 06, 2026 at 09:57:50AM +0100, Linus Walleij wrote:
> > > There is no need to try to second-guess the compiler when
> > > clearing memory. Just call memset() like everyone else.
> >
> > Hmm, that "like everyone else" made me think - why not move this to
> > generic code and only the 1-2 platforms that need their own should
> > override it? Could we do the same with copy_page()?
> >
> > Sorry, more work all of a sudden ;).
> 
> I actually had that planned, I just wanted to know if this would
> be fine for arm64 first so that there is a user.
> 
> It seems you are on board so I will send a 2-patch series
> next.

We might as well merge the arm64 patch first and do the cross-arch
cleanup separately, queued via akpm's tree.

> > > 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.
> >
> > I assume the benchmarks ran on real hardware (had to ask, last time you
> > mentioned qemu ;)).
> 
> 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.

It wasn't clear to me where the fastpath tool ran ;).

Thanks.

-- 
Catalin



More information about the linux-arm-kernel mailing list