android_kernel_xiaomi_sm8350/mm
Roland Dreier a4523a8b38 [PATCH] slab: Fix kmem_cache_destroy() on NUMA
With CONFIG_NUMA set, kmem_cache_destroy() may fail and say "Can't
free all objects."  The problem is caused by sequences such as the
following (suppose we are on a NUMA machine with two nodes, 0 and 1):

 * Allocate an object from cache on node 0.
 * Free the object on node 1.  The object is put into node 1's alien
   array_cache for node 0.
 * Call kmem_cache_destroy(), which ultimately ends up in __cache_shrink().
 * __cache_shrink() does drain_cpu_caches(), which loops through all nodes.
   For each node it drains the shared array_cache and then handles the
   alien array_cache for the other node.

However this means that node 0's shared array_cache will be drained,
and then node 1 will move the contents of its alien[0] array_cache
into that same shared array_cache.  node 0's shared array_cache is
never looked at again, so the objects left there will appear to be in
use when __cache_shrink() calls __node_shrink() for node 0.  So
__node_shrink() will return 1 and kmem_cache_destroy() will fail.

This patch fixes this by having drain_cpu_caches() do
drain_alien_cache() on every node before it does drain_array() on the
nodes' shared array_caches.

The problem was originally reported by Or Gerlitz <ogerlitz@voltaire.com>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-05-16 07:59:32 -07:00
..
bootmem.c [PATCH] x86_64: Handle empty PXMs that only contain hotplug memory 2006-04-09 11:53:16 -07:00
fadvise.c [PATCH] sys_sync_file_range() 2006-03-31 12:18:54 -08:00
filemap_xip.c
filemap.c [PATCH] Add find_get_pages_contig(): contiguous variant of find_get_pages() 2006-04-27 08:59:48 +02:00
filemap.h
fremap.c
highmem.c BUG_ON() Conversion in mm/highmem.c 2006-04-02 13:47:35 +02:00
hugetlb.c
internal.h
Kconfig
madvise.c [PATCH] Fix MADV_REMOVE protection checking 2006-04-17 18:22:18 -07:00
Makefile
memory_hotplug.c [PATCH] spufs: fix for CONFIG_NUMA 2006-05-01 18:17:46 -07:00
memory.c
mempolicy.c [PATCH] Remove cond_resched in gather_stats() 2006-04-20 07:54:03 -07:00
mempool.c
migrate.c [PATCH] page migration: Fix fallback behavior for dirty pages 2006-05-01 18:17:45 -07:00
mincore.c
mlock.c
mmap.c [PATCH] overcommit: use totalreserve_pages 2006-04-11 06:18:32 -07:00
mmzone.c
mprotect.c
mremap.c
msync.c
nommu.c [PATCH] overcommit: use totalreserve_pages for nommu 2006-04-11 06:18:32 -07:00
oom_kill.c [PATCH] mm: fix mm_struct reference counting bugs in mm/oom_kill.c 2006-04-19 09:13:50 -07:00
page_alloc.c [PATCH] setup_per_zone_pages_min() overflow fix 2006-05-15 11:20:55 -07:00
page_io.c
page-writeback.c [PATCH] page-writeback comment fixes 2006-04-11 06:18:46 -07:00
pdflush.c
prio_tree.c
readahead.c
rmap.c
shmem.c [PATCH] add migratepage address space op to shmem 2006-04-22 09:19:52 -07:00
slab.c [PATCH] slab: Fix kmem_cache_destroy() on NUMA 2006-05-16 07:59:32 -07:00
slob.c [PATCH] mm/slob.c: for_each_possible_cpu(), not NR_CPUS 2006-04-19 09:13:49 -07:00
sparse.c [PATCH] add slab_is_available() routine for boot code 2006-05-15 11:20:56 -07:00
swap_state.c BUG_ON() Conversion in mm/swap_state.c 2006-04-01 01:25:12 +02:00
swap.c
swapfile.c
thrash.c
tiny-shmem.c
truncate.c
util.c
vmalloc.c BUG_ON() Conversion in mm/vmalloc.c 2006-04-01 01:26:09 +02:00
vmscan.c [PATCH] Remove __devinit and __cpuinit from notifier_call definitions 2006-04-26 08:30:03 -07:00