]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] CPU Hotplug mm/slab.c CPU_UP_CANCELED fix
authorAndrew Morton <akpm@digeo.com>
Thu, 6 Feb 2003 00:59:17 +0000 (16:59 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 6 Feb 2003 00:59:17 +0000 (16:59 -0800)
Patch from Manfred Spraul.

Fixes a bug which was exposed by Zwane's hotplug CPU work.  The
cache_cache.array pointer is initially given a temp bootstrap area, which is
later converted over to the final value after the CPU is brought up.

But if slab is enhanced to permit cancellation of a CPU bringup, this pointer
ends up pointing at stale memory.  So reinitialise it by hand when
kmem_cache_init() is run.

mm/slab.c

index 87f623dde759e0f0587d2362bf8611752a4debf7..af0886e3c7a504a350d05d9fcc6d2d6310230710 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -439,7 +439,6 @@ struct arraycache_init initarray_generic __initdata = { { 0, BOOT_CPUCACHE_ENTRI
 static kmem_cache_t cache_cache = {
        .lists          = LIST3_INIT(cache_cache.lists),
        /* Allow for boot cpu != 0 */
-       .array          = { [0 ... NR_CPUS-1] = &initarray_cache.cache },
        .batchcount     = 1,
        .limit          = BOOT_CPUCACHE_ENTRIES,
        .objsize        = sizeof(kmem_cache_t),
@@ -611,6 +610,7 @@ void __init kmem_cache_init(void)
        init_MUTEX(&cache_chain_sem);
        INIT_LIST_HEAD(&cache_chain);
        list_add(&cache_cache.next, &cache_chain);
+       cache_cache.array[smp_processor_id()] = &initarray_cache.cache;
 
        cache_estimate(0, cache_cache.objsize, 0,
                        &left_over, &cache_cache.num);