[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170615082410.GE1486@dhcp22.suse.cz>
Date: Thu, 15 Jun 2017 10:24:10 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Wei Yang <richard.weiyang@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
Andrea Arcangeli <aarcange@...hat.com>,
Reza Arbab <arbab@...ux.vnet.ibm.com>,
Yasuaki Ishimatsu <yasu.isimatu@...il.com>,
qiuxishi@...wei.com, Kani Toshimitsu <toshi.kani@....com>,
slaoub@...il.com, Joonsoo Kim <js1304@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
David Rientjes <rientjes@...gle.com>,
Daniel Kiper <daniel.kiper@...cle.com>,
Igor Mammedov <imammedo@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable
nodes
On Thu 15-06-17 11:29:27, Wei Yang wrote:
[...]
> >+static inline bool movable_pfn_range(int nid, struct zone *default_zone,
> >+ unsigned long start_pfn, unsigned long nr_pages)
> >+{
> >+ if (!allow_online_pfn_range(nid, start_pfn, nr_pages,
> >+ MMOP_ONLINE_KERNEL))
> >+ return true;
> >+
> >+ if (!movable_node_is_enabled())
> >+ return false;
> >+
> >+ return !zone_intersects(default_zone, start_pfn, nr_pages);
> >+}
> >+
>
> To be honest, I don't understand this clearly.
>
> move_pfn_range() will choose and move the range to a zone based on the
> online_type, where we have two cases:
> 1. ONLINE_MOVABLE -> ZONE_MOVABLE will be chosen
> 2. ONLINE_KEEP -> ZONE_NORMAL is the default while ZONE_MOVABLE will be
> chosen in case movable_pfn_range() returns true.
>
> There are three conditions in movable_pfn_range():
> 1. Not allowed in kernel_zone, returns true
> 2. Movable_node not enabled, return false
> 3. Range [start_pfn, start_pfn + nr_pages) doesn't intersect with
> default_zone, return true
>
> The first one is inherited from original code, so lets look at the other two.
>
> Number 3 is easy to understand, if the hot-added range is already part of
> ZONE_NORMAL, use it.
>
> Number 2 makes me confused. If movable_node is not enabled, ZONE_NORMAL will
> be chosen. If movable_node is enabled, it still depends on other two
> condition. So how a memory_block is onlined to ZONE_MOVABLE because
> movable_node is enabled?
This is simple. If the movable_node is set then ONLINE_KEEP defaults to
the movable zone unless the range is already covered by a kernel zone
(read Normal zone most of the time).
> What I see is you would forbid a memory_block to be
> onlined to ZONE_MOVABLE when movable_node is not enabled.
Please note that this is ONLINE_KEEP not ONLINE_MOVABLE and as such the
movable zone is used only if we are withing the movable zone range
already (test 1).
> Instead of you would
> online a memory_block to ZONE_MOVABLE when movable_node is enabled, which is
> implied in your change log.
>
> BTW, would you mind giving me these two information?
> 1. Which branch your code is based on? I have cloned your
> git(//git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git), while still see
> some difference.
yes this is based on the mmotm tree (use since-4.11 or auto-latest
branch)
> 2. Any example or test case I could try your patch and see the difference? It
> would be better if it could run in qemu+kvm.
See http://lkml.kernel.org/r/20170421120512.23960-1-mhocko@kernel.org
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists