linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com,
	akpm@linux-foundation.org, mgorman@techsingularity.net,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, vbabka@suse.cz,
	bharata@linux.vnet.ibm.com
Subject: Re: [PATCH v1] mm: optimize memory hotplug
Date: Wed, 31 Jan 2018 09:43:13 +0100	[thread overview]
Message-ID: <20180131084313.GP21609@dhcp22.suse.cz> (raw)
In-Reply-To: <20180131054243.28141-1-pasha.tatashin@oracle.com>

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2018-01-31  8:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31  5:42 Pavel Tatashin
2018-01-31  8:43 ` Michal Hocko [this message]
2018-01-31 18:38   ` Pavel Tatashin
2018-02-02  6:05 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180131084313.GP21609@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=daniel.m.jordan@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=pasha.tatashin@oracle.com \
    --cc=steven.sistare@oracle.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox