aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorGlauber Costa <glommer@parallels.com>2013-02-22 11:20:00 -0500
committerPekka Enberg <penberg@kernel.org>2013-02-28 02:29:38 -0500
commit7d557b3cb69398d83ceabad9cf147c93a3aa97fd (patch)
treef1582b8912fe77bac85dc0e1cbac44acab1a7e7a /mm
parentb1e0541674904db00e17ce646b0a1d54f59136a5 (diff)
slub: correctly bootstrap boot caches
After we create a boot cache, we may allocate from it until it is bootstraped. This will move the page from the partial list to the cpu slab list. If this happens, the loop: list_for_each_entry(p, &n->partial, lru) that we use to scan for all partial pages will yield nothing, and the pages will keep pointing to the boot cpu cache, which is of course, invalid. To do that, we should flush the cache to make sure that the cpu slab is back to the partial list. Signed-off-by: Glauber Costa <glommer@parallels.com> Reported-by: Steffen Michalke <StMichalke@web.de> Tested-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Christoph Lameter <cl@linux.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 6184b0821f7e..aa0728daf8bb 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3552,6 +3552,12 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache)
3552 3552
3553 memcpy(s, static_cache, kmem_cache->object_size); 3553 memcpy(s, static_cache, kmem_cache->object_size);
3554 3554
3555 /*
3556 * This runs very early, and only the boot processor is supposed to be
3557 * up. Even if it weren't true, IRQs are not up so we couldn't fire
3558 * IPIs around.
3559 */
3560 __flush_cpu_slab(s, smp_processor_id());
3555 for_each_node_state(node, N_NORMAL_MEMORY) { 3561 for_each_node_state(node, N_NORMAL_MEMORY) {
3556 struct kmem_cache_node *n = get_node(s, node); 3562 struct kmem_cache_node *n = get_node(s, node);
3557 struct page *p; 3563 struct page *p;