]> git.ipfire.org Git - people/arne_f/kernel.git/commit
SLUB: Fix memory leak by not reusing cpu_slab
authorChristoph Lameter <clameter@sgi.com>
Mon, 5 Nov 2007 19:23:51 +0000 (11:23 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Nov 2007 17:25:52 +0000 (09:25 -0800)
commit06283bea26adeb6dfa421419d2aa3979d63e50f1
treeefd94b466831fa2b11236aa6eefc83c72c0a2a45
parent4d3a89200a923ef066014b850dc9c53d810f78bb
SLUB: Fix memory leak by not reusing cpu_slab

backport of 05aa345034de6ae9c77fb93f6a796013641d57d5 from Linus's tree.

SLUB: Fix memory leak by not reusing cpu_slab

Fix the memory leak that may occur when we attempt to reuse a cpu_slab
that was allocated while we reenabled interrupts in order to be able to
grow a slab cache. The per cpu freelist may contain objects and in that
situation we may overwrite the per cpu freelist pointer loosing objects.
This only occurs if we find that the concurrently allocated slab fits
our allocation needs.

If we simply always deactivate the slab then the freelist will be properly
reintegrated and the memory leak will go away.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/slub.c