Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1666553

Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable nodes

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable nodes
Date 2017-06-15 10:30 +0200
Message-ID <tSyk9-5P-15@gated-at.bofh.it> (permalink)
References <tQ4JB-4eB-23@gated-at.bofh.it> <tStNv-5C5-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm, memory_hotplug: support movable_node for hotplugable nodes Michal Hocko <mhocko@kernel.org> - 2017-06-08 14:30 +0200
  Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Wei Yang <richard.weiyang@gmail.com> - 2017-06-10 16:40 +0200
    Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Michal Hocko <mhocko@kernel.org> - 2017-06-12 08:40 +0200
  Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Wei Yang <richard.weiyang@gmail.com> - 2017-06-11 03:50 +0200
    Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Michal Hocko <mhocko@kernel.org> - 2017-06-12 08:40 +0200
  Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Wei Yang <richard.weiyang@gmail.com> - 2017-06-12 06:30 +0200
    Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Michal Hocko <mhocko@kernel.org> - 2017-06-12 08:50 +0200
      Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Vlastimil Babka <vbabka@suse.cz> - 2017-06-14 11:10 +0200
        Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Wei Yang <richard.weiyang@gmail.com> - 2017-06-15 03:10 +0200
      Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Wei Yang <richard.weiyang@gmail.com> - 2017-06-14 11:10 +0200
      Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Wei Yang <richard.weiyang@gmail.com> - 2017-06-15 05:20 +0200
        Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Michal Hocko <mhocko@kernel.org> - 2017-06-15 10:20 +0200
  Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Vlastimil Babka <vbabka@suse.cz> - 2017-06-12 11:00 +0200
  [PATCH -v2] mm, memory_hotplug: support movable_node for hotplugable  nodes Michal Hocko <mhocko@kernel.org> - 2017-06-12 13:20 +0200
  Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Wei Yang <richard.weiyang@gmail.com> - 2017-06-15 05:40 +0200
    Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Michal Hocko <mhocko@kernel.org> - 2017-06-15 10:30 +0200
  Re: [PATCH] mm, memory_hotplug: support movable_node for hotplugable  nodes Reza Arbab <arbab@linux.vnet.ibm.com> - 2017-06-15 17:50 +0200

csiph-web