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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 31 Jan 2018 09:43:13 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Pavel Tatashin <pasha.tatashin@...cle.com>
Cc:     steven.sistare@...cle.com, daniel.m.jordan@...cle.com,
        akpm@...ux-foundation.org, mgorman@...hsingularity.net,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        gregkh@...uxfoundation.org, vbabka@...e.cz,
        bharata@...ux.vnet.ibm.com
Subject: Re: [PATCH v1] mm: optimize memory hotplug

On Wed 31-01-18 00:42:43, Pavel Tatashin wrote:
> This patch was inspired by the discussion of this problem:
> http://lkml.kernel.org/r/20180130083006.GB1245@in.ibm.com
> 
> Currently, during memory hotplugging we traverse struct pages several
> times:
> 
> 1. memset(0) in sparse_add_one_section()
> 2. loop in __add_section() to set do: set_page_node(page, nid); and
>    SetPageReserved(page);
> 3. loop in pages_correctly_reserved() to check that SetPageReserved is set.
> 4. loop in memmap_init_zone() to call __init_single_pfn()
> 
> This patch removes loops 1, 2, and 3 and only leaves the loop 4, where all
> struct page fields are initialized in one go, the same as it is now done
> during boot.

So how do we check that there is no page_to_nid() user before we online
the page? I remember I was fighting strange bugs when reworking this
code. I have forgot all the details of course, I just remember some
nasty and subtle code paths. Maybe we have got rid of those in the past
year but this should be done really carefully. We might have similar
dependences on PageReserved.

That being said, it would be great if we could simplify this. I think
that 3) can be removed right away. It is a pure paranoia. 
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ