[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAG_fn=WOJb7bsP2JfhH+PRmhZ=4WY8U+vUugkTpXL4F5sz752g@mail.gmail.com>
Date: Wed, 11 Mar 2020 18:28:42 +0100
From: Alexander Potapenko <glider@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Mark Rutland <mark.rutland@....com>,
Will Deacon <will.deacon@....com>,
Catalin Marinas <catalin.marinas@....com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Reason 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
Powered by blists - more mailing lists