Hi The attached oops occurs during boot when the cache is converted from static to allocated cache ( kmem_cache_create() ) The attached patch might be a work around until mainline kernel slab code does something The occurance in kmem_cache_destroy() is a best guess, my boot hasn't made it far enough to test it. static cache is initialized prior to smp_init, the boot cpu is the only one running. There is no mechanism to initialize numa style cache heads per smp cpu (that I found). after the memcpy, accessing the array list_lock for cpu 2 causes the oops. This got me past the slab stuff into the sunzilog oops ... Thanx Ray
Unable to handle kernel NULL pointer dereference tsk->{mm,active_mm}->context = ffffffff tsk->{mm,active_mm}->pgd = fc000000 swapper(1): Oops [#1] PSR: 40800fc5 PC: f01e00a4 NPC: f01e00a8 Y: 00000000 Not tainted PC: <_spin_lock_irq+0x14/0x28> %G: 00000003 f0021510 40800fe6 00000001 00000007 00656c00 f0d0e000 000000ff %O: 408000e6 00000001 00000001 00000000 f02094d4 00000000 f0d0fc70 f01e009c RPC: <_spin_lock_irq+0xc/0x28> %L: 00000002 f0106044 f0106254 00000001 00000002 00000000 00007fff 0000007f %I: 00000024 f02094d4 00000001 00000001 f010f74c ffff8c4b f0d0fcd8 f007a75c Caller[f007a75c]: do_tune_cpucache+0xe0/0x1ac Caller[f007a890]: enable_cpucache+0x68/0x90 Caller[f0078f84]: kmem_cache_create+0x2ac/0x3b0 Caller[f025622c]: free_area_init+0x20/0x30 Caller[f0245224]: sun4m_init+0xb0/0x328 Caller[f0014104]: init+0x60/0x19c Caller[f00195bc]: kernel_thread+0x3c/0x50 Caller[f001401c]: rest_init+0x18/0x34 Caller[f02451b4]: sun4m_init+0x40/0x328 Caller[f02447c8]: _etext+0x642c4/0x64af4 Caller[00000000]: 0x8 Instruction DUMP: 9de3bf98 7ff8dbe9 01000000 <c46e0000> 8090a000 328000c9 c4 0e0000 01000000 81c7e008
diff --git a/mm/slab.c b/mm/slab.c index 85c2e03..f70cb11 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2398,7 +2398,7 @@ int kmem_cache_destroy(struct kmem_cache if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU)) synchronize_rcu(); - for_each_online_cpu(i) + for_each_online_node(i) kfree(cachep->array[i]); /* NUMA: free the list3 structures */ @@ -3597,7 +3597,7 @@ static int do_tune_cpucache(struct kmem_ int i, err; memset(&new.new, 0, sizeof(new.new)); - for_each_online_cpu(i) { + for_each_online_node(i) { new.new[i] = alloc_arraycache(cpu_to_node(i), limit, batchcount); if (!new.new[i]) { @@ -3615,7 +3615,7 @@ static int do_tune_cpucache(struct kmem_ cachep->limit = limit; cachep->shared = shared; - for_each_online_cpu(i) { + for_each_online_node(i) { struct array_cache *ccold = new.new[i]; if (!ccold) continue;