slub: move discard_slab out of node lock
authorShaohua Li <shaohua.li@intel.com>
Mon, 14 Nov 2011 05:34:13 +0000 (13:34 +0800)
committerPekka Enberg <penberg@kernel.org>
Tue, 15 Nov 2011 18:41:00 +0000 (20:41 +0200)
commit9ada19342b2441f290f0043ed7c562682c8c4ede
tree702599b3b616d4bce7415012d8d4d18c7c43e5ec
parentf64ae042d94d376b54e7a343d93c48561e9d2e16
slub: move discard_slab out of node lock

Lockdep reports there is potential deadlock for slub node list_lock.
discard_slab() is called with the lock hold in unfreeze_partials(),
which could trigger a slab allocation, which could hold the lock again.

discard_slab() doesn't need hold the lock actually, if the slab is
already removed from partial list.

Acked-by: Christoph Lameter <cl@linux.com>
Reported-and-tested-by: Yong Zhang <yong.zhang0@gmail.com>
Reported-and-tested-by: Julie Sullivan <kernelmail.jms@gmail.com>
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slub.c