lkml.org 
[lkml]   [2018]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2018-01-31 09:43    [W:0.039 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site