[PATCH] slab: fix memory leak in alloc_kmemlist
Christoph Lameter authored
We have had this memory leak for a while now.  The situation is complicated
by the use of alloc_kmemlist() as a function to resize various caches by
do_tune_cpucache().

What we do here is first of all make sure that we deallocate properly in
the loop over all the nodes.

If we are just resizing caches then we can simply return with -ENOMEM if an
allocation fails.

If the cache is new then we need to rollback and remove all earlier
allocations.

We detect that a cache is new by checking if the link to the global cache
chain has been setup.  This is a bit hackish ....

(also fix up too overlong lines that I added in the last patch...)
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
0718dc2a
Name Last commit Last update
..
Kconfig [PATCH] page migration reorg
Makefile [PATCH] page migration reorg
bootmem.c [PATCH] FRV: Clean up bootmem allocator's page freeing algorithm
fadvise.c [PATCH] fadvise(): write commands
filemap.c [PATCH] fadvise(): write commands
filemap.h [PATCH] xip: reduce code duplication
filemap_xip.c [PATCH] replace inode_update_time with file_update_time
fremap.c VM: add common helper function to create the page tables
highmem.c [PATCH] Block queue IO tracing support (blktrace) as of 2006-03-23
hugetlb.c [PATCH] mm: hugetlb alloc_fresh_huge_page bogus node loop fix
internal.h [PATCH] remove set_page_count() outside mm/
madvise.c [PATCH] madvise MADV_DONTFORK/MADV_DOFORK
memory.c [PATCH] hugepage: Fix hugepage logic in free_pgtables() harder
memory_hotplug.c [PATCH] memory hotadd: pgdat->node_present_pages fix
mempolicy.c [PATCH] cpuset memory spread slab cache optimizations
mempool.c [PATCH] mm: kill kmem_cache_t usage
migrate.c [PATCH] page migration reorg
mincore.c [PATCH] freepgt: sys_mincore ignore FIRST_USER_PGD_NR
mlock.c [PATCH] move capable() to capability.h
mmap.c [PATCH] mm: use kmem_cache_zalloc
mprotect.c [PATCH] Enable mprotect on huge pages
mremap.c [PATCH] move capable() to capability.h
msync.c [PATCH] msync(): use do_fsync()
nommu.c [PATCH] mm: nommu use compound pages
oom_kill.c [PATCH] out_of_memory() locking fix
page-writeback.c [PATCH] set_page_dirty() return value fixes
page_alloc.c [PATCH] cpusets: only wakeup kswapd for zones in the current cpuset
page_io.c [PATCH] mm: split page table lock
pdflush.c [PATCH] Swap Migration V5: PF_SWAPWRITE to allow writing to swap
prio_tree.c Linux-2.6.12-rc2
readahead.c [PATCH] ext3_readdir: use generic readahead
rmap.c [PATCH] mm: more CONFIG_DEBUG_VM
shmem.c [PATCH] shmem: inline to avoid warning
slab.c [PATCH] slab: fix memory leak in alloc_kmemlist
slob.c [PATCH] slab: introduce kmem_cache_zalloc allocator
sparse.c [PATCH] Change maxaligned_in_smp alignemnt macros to internodealigned_in_smp macros
swap.c [PATCH] mm: less atomic ops
swap_state.c [PATCH] page migration reorg
swapfile.c [PATCH] swsusp: userland interface
thrash.c [PATCH] temporarily disable swap token on memory pressure
tiny-shmem.c [PATCH] do_truncate() call fix in tiny-shmem.c
truncate.c [PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
util.c [PATCH] slab: optimize constant-size kzalloc calls
vmalloc.c [PATCH] kernel-doc: fix warnings in vmalloc.c
vmscan.c [PATCH] page migration reorg