LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Reason to not use __GFP_ZERO in __alloc_zeroed_user_highpage() on ARM64?
@ 2020-03-11 17:28 Alexander Potapenko
  0 siblings, 0 replies; only message in thread
From: Alexander Potapenko @ 2020-03-11 17:28 UTC (permalink / raw)
  To: Andrew Morton, Mark Rutland, Will Deacon, Catalin Marinas; +Cc: LKML

Hi,

I've noticed that certain arches (alpha, ia64, m68k, s390, x86) have
__alloc_zeroed_user_highpage() defined as:

  alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vmaddr)

, whereas in other cases it is defined as
alloc_page_vma()+clear_user_page() (see
https://elixir.bootlin.com/linux/latest/source/include/linux/highmem.h#L182)

Is there a reason for this?

I'm asking because on ARM64 with init_on_alloc=1
__alloc_zeroed_user_highpage() appears to initialize the page twice.
Adding __GFP_ZERO and removing clear_user_page() seems to work (and
remove the double initialization), but I suppose this code was written
on purpose? Am I missing something?

Thanks,

-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-11 17:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 17:28 Reason to not use __GFP_ZERO in __alloc_zeroed_user_highpage() on ARM64? Alexander Potapenko

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).