[RFC PATCH 14/23 V2] slub, hotplug: ignore unrelated node's hot-adding and hot-removing

Subsystems: memory management, slab allocator, the rest

STALE5114d

2 messages, 2 authors, 2012-08-02 · open the first message on its own page

[RFC PATCH 14/23 V2] slub, hotplug: ignore unrelated node's hot-adding and hot-removing

From: Lai Jiangshan <hidden>
Date: 2012-08-02 02:53:02

SLUB only fucus on the nodes which has normal memory, so ignore the other
node's hot-adding and hot-removing.

Signed-off-by: Lai Jiangshan <redacted>
---
 mm/slub.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 8c691fa..4c5bdc0 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3577,6 +3577,9 @@ static void slab_mem_offline_callback(void *arg)
 	if (offline_node < 0)
 		return;
 
+	if (page_zonenum(pfn_to_page(marg->start_pfn)) > ZONE_NORMAL)
+		return;
+
 	down_read(&slub_lock);
 	list_for_each_entry(s, &slab_caches, list) {
 		n = get_node(s, offline_node);
@@ -3611,6 +3614,9 @@ static int slab_mem_going_online_callback(void *arg)
 	if (nid < 0)
 		return 0;
 
+	if (page_zonenum(pfn_to_page(marg->start_pfn)) > ZONE_NORMAL)
+		return 0;
+
 	/*
 	 * We are bringing a node online. No memory is available yet. We must
 	 * allocate a kmem_cache_node structure in order to bring the node
-- 
1.7.1

Re: [RFC PATCH 14/23 V2] slub, hotplug: ignore unrelated node's hot-adding and hot-removing

From: Christoph Lameter <hidden>
Date: 2012-08-02 16:05:01

On Thu, 2 Aug 2012, Lai Jiangshan wrote:
SLUB only fucus on the nodes which has normal memory, so ignore the other
node's hot-adding and hot-removing.
You would need to do the same for SLAB. SLAB has an easier time with
falling back to other nodes (and therefore does not show up in your
tests) but as a result SLAB will be quite ineffective
because it created bogus structures that are never used yet constantly
traversed.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help