[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <63a3648aa6d49ad2dcf8c885d6a874e6c91624a0.1697799303.git.zhengqi.arch@bytedance.com>
Date: Fri, 20 Oct 2023 19:04:46 +0800
From: Qi Zheng <zhengqi.arch@...edance.com>
To: akpm@...ux-foundation.org, rppt@...nel.org, david@...hat.com,
vbabka@...e.cz, mhocko@...e.com
Cc: willy@...radead.org, mgorman@...hsingularity.net, mingo@...nel.org,
aneesh.kumar@...ux.ibm.com, ying.huang@...el.com,
hannes@...xchg.org, osalvador@...e.de,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Qi Zheng <zhengqi.arch@...edance.com>
Subject: [PATCH v4 2/2] mm: memory_hotplug: drop memoryless node from fallback lists
In offline_pages(), if a node becomes memoryless, we
will clear its N_MEMORY state by calling node_states_clear_node().
But we do this after rebuilding the zonelists by calling
build_all_zonelists(), which will cause this memoryless node to
still be in the fallback list of other nodes. This will incur
some runtime overhead.
To drop memoryless nodes from fallback lists in this case, just
call node_states_clear_node() before calling build_all_zonelists().
Signed-off-by: Qi Zheng <zhengqi.arch@...edance.com>
Acked-by: David Hildenbrand <david@...hat.com>
Acked-by: Ingo Molnar <mingo@...nel.org>
---
mm/memory_hotplug.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index d4a364fdaf8f..f019f7d6272c 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -2036,12 +2036,16 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
/* reinitialise watermarks and update pcp limits */
init_per_zone_wmark_min();
+ /*
+ * Make sure to mark the node as memory-less before rebuilding the zone
+ * list. Otherwise this node would still appear in the fallback lists.
+ */
+ node_states_clear_node(node, &arg);
if (!populated_zone(zone)) {
zone_pcp_reset(zone);
build_all_zonelists(NULL);
}
- node_states_clear_node(node, &arg);
if (arg.status_change_nid >= 0) {
kcompactd_stop(node);
kswapd_stop(node);
--
2.30.2
Powered by blists - more mailing lists