lkml.org 
[lkml]   [2020]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectReason to not use __GFP_ZERO in __alloc_zeroed_user_highpage() on ARM64?
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

\
 
 \ /
  Last update: 2020-03-11 18:29    [W:0.024 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site