diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2012-12-11 19:01:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-11 20:22:23 -0500 |
commit | b9d5ab2562eceeada5e4837a621b6260574dd11d (patch) | |
tree | d2f984db379ed9d34bc2ce49ff354879ff7da6c4 /mm/slub.c | |
parent | d9713679dbd2a6ecb840cd5b65a3ec555c1ec3d4 (diff) |
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@cn.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Rob Landley <rob@landley.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3573,7 +3573,7 @@ static void slab_mem_offline_callback(void *arg) | |||
3573 | struct memory_notify *marg = arg; | 3573 | struct memory_notify *marg = arg; |
3574 | int offline_node; | 3574 | int offline_node; |
3575 | 3575 | ||
3576 | offline_node = marg->status_change_nid; | 3576 | offline_node = marg->status_change_nid_normal; |
3577 | 3577 | ||
3578 | /* | 3578 | /* |
3579 | * If the node still has available memory. we need kmem_cache_node | 3579 | * If the node still has available memory. we need kmem_cache_node |
@@ -3606,7 +3606,7 @@ static int slab_mem_going_online_callback(void *arg) | |||
3606 | struct kmem_cache_node *n; | 3606 | struct kmem_cache_node *n; |
3607 | struct kmem_cache *s; | 3607 | struct kmem_cache *s; |
3608 | struct memory_notify *marg = arg; | 3608 | struct memory_notify *marg = arg; |
3609 | int nid = marg->status_change_nid; | 3609 | int nid = marg->status_change_nid_normal; |
3610 | int ret = 0; | 3610 | int ret = 0; |
3611 | 3611 | ||
3612 | /* | 3612 | /* |