• Ravikiran G Thirumalai's avatar
    [PATCH] NUMA slab locking fixes: fix cpu down and up locking · 4484ebf1
    Ravikiran G Thirumalai authored
    This fixes locking and bugs in cpu_down and cpu_up paths of the NUMA slab
    allocator.  Sonny Rao <sonny@burdell.org> reported problems sometime back on
    POWER5 boxes, when the last cpu on the nodes were being offlined.  We could
    not reproduce the same on x86_64 because the cpumask (node_to_cpumask) was not
    being updated on cpu down.  Since that issue is now fixed, we can reproduce
    Sonny's problems on x86_64 NUMA, and here is the fix.
    
    The problem earlier was on CPU_DOWN, if it was the last cpu on the node to go
    down, the array_caches (shared, alien) and the kmem_list3 of the node were
    being freed (kfree) with the kmem_list3 lock held.  If the l3 or the
    array_caches were to come from the same cache being cleared, we hit on
    badness.
    
    This patch cleans up the locking in cpu_up and cpu_down path.  We cannot
    really free l3 on cpu down because, there is no node offlining yet and even
    though a cpu is not yet up, node local memory can be allocated for it.  So l3s
    are usually allocated at keme_cache_create and destroyed at
    kmem_cache_destroy.  Hence, we don't need cachep->spinlock protection to get
    to the cachep->nodelist[nodeid] either.
    
    Patch survived onlining and offlining on a 4 core 2 node Tyan box with a 4
    dbench process running all the time.
    Signed-off-by: default avatarAlok N Kataria <alokk@calsoftinc.com>
    Signed-off-by: default avatarRavikiran Thirumalai <kiran@scalex86.org>
    Cc: Christoph Lameter <christoph@lameter.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    4484ebf1
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
bootmem.c Loading commit data...
fadvise.c Loading commit data...
filemap.c Loading commit data...
filemap.h Loading commit data...
filemap_xip.c Loading commit data...
fremap.c Loading commit data...
highmem.c Loading commit data...
hugetlb.c Loading commit data...
internal.h Loading commit data...
madvise.c Loading commit data...
memory.c Loading commit data...
memory_hotplug.c Loading commit data...
mempolicy.c Loading commit data...
mempool.c Loading commit data...
mincore.c Loading commit data...
mlock.c Loading commit data...
mmap.c Loading commit data...
mprotect.c Loading commit data...
mremap.c Loading commit data...
msync.c Loading commit data...
nommu.c Loading commit data...
oom_kill.c Loading commit data...
page-writeback.c Loading commit data...
page_alloc.c Loading commit data...
page_io.c Loading commit data...
pdflush.c Loading commit data...
prio_tree.c Loading commit data...
readahead.c Loading commit data...
rmap.c Loading commit data...
shmem.c Loading commit data...
slab.c Loading commit data...
slob.c Loading commit data...
sparse.c Loading commit data...
swap.c Loading commit data...
swap_state.c Loading commit data...
swapfile.c Loading commit data...
thrash.c Loading commit data...
tiny-shmem.c Loading commit data...
truncate.c Loading commit data...
util.c Loading commit data...
vmalloc.c Loading commit data...
vmscan.c Loading commit data...