lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Oct 2020 10:10:40 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Vlastimil Babka <vbabka@...e.cz>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Alexander Potapenko <glider@...gle.com>,
        Kees Cook <keescook@...omium.org>,
        Michal Hocko <mhocko@...nel.org>,
        Mateusz Nosek <mateusznosek0@...il.com>
Subject: Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

On 26.10.20 18:33, Vlastimil Babka wrote:
> prep_new_page() will always zero a new page (regardless of __GFP_ZERO) when
> init_on_alloc is enabled, but will also always skip zeroing if the page was
> already zeroed on free by init_on_free or page poisoning.
> 
> The latter check implemented by free_pages_prezeroed() can involve two
> different static keys. As prep_new_page() is really a hot path, let's introduce
> a single static key free_pages_not_prezeroed for this purpose and initialize it
> in init_mem_debugging().

Is this actually observable in practice? This smells like 
micro-optimization to me.

Also, I thought the whole reason for static keys is to have basically no 
overhead at runtime, so I wonder if replacing two static key checks by a 
single one actually makes *some* difference.

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ