The patch titled Subject: slub, hotplug: ignore unrelated node's hot-adding and hot-removing has been added to the -mm tree. Its filename is slub-hotplug-ignore-unrelated-nodes-hot-adding-and-hot-removing.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> Subject: slub, hotplug: ignore unrelated node's hot-adding and hot-removing SLUB only focuses on the nodes which have normal memory and it ignores the other node's hot-adding and hot-removing. Aka: if some memory of a node which has no onlined memory is online, but this new memory onlined is not normal memory (for example, highmem), we should not allocate kmem_cache_node for SLUB. And if the last normal memory is offlined, but the node still has memory, we should remove kmem_cache_node for that node. (The current code delays it when all of the memory is offlined) So we only do something when marg->status_change_nid_normal > 0. marg->status_change_nid is not suitable here. The same problem doesn't exist in SLAB, because SLAB allocates kmem_list3 for every node even the node don't have normal memory, SLAB tolerates kmem_list3 on alien nodes. SLUB only focuses on the nodes which have normal memory, it don't tolerate alien kmem_cache_node. The patch makes SLUB become self-compatible and avoids WARNs and BUGs in rare conditions. Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Minchan Kim <minchan.kim@xxxxxxxxx> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@xxxxxxxxxxxxxx> Cc: Rob Landley <rob@xxxxxxxxxxx> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Jiang Liu <jiang.liu@xxxxxxxxxx> Cc: Kay Sievers <kay.sievers@xxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Wen Congyang <wency@xxxxxxxxxxxxxx> Acked-by: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN mm/slub.c~slub-hotplug-ignore-unrelated-nodes-hot-adding-and-hot-removing mm/slub.c --- a/mm/slub.c~slub-hotplug-ignore-unrelated-nodes-hot-adding-and-hot-removing +++ a/mm/slub.c @@ -3567,7 +3567,7 @@ static void slab_mem_offline_callback(vo struct memory_notify *marg = arg; int offline_node; - offline_node = marg->status_change_nid; + offline_node = marg->status_change_nid_normal; /* * If the node still has available memory. we need kmem_cache_node @@ -3600,7 +3600,7 @@ static int slab_mem_going_online_callbac struct kmem_cache_node *n; struct kmem_cache *s; struct memory_notify *marg = arg; - int nid = marg->status_change_nid; + int nid = marg->status_change_nid_normal; int ret = 0; /* _ Patches currently in -mm which might be from laijs@xxxxxxxxxxxxxx are linux-next.patch memory_hotplug-fix-possible-incorrect-node_states.patch slub-hotplug-ignore-unrelated-nodes-hot-adding-and-hot-removing.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html