]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm, slab: lock the correct nodelist after reenabling irqs
authorDavid Rientjes <rientjes@google.com>
Wed, 29 Aug 2012 02:57:21 +0000 (19:57 -0700)
committerPekka Enberg <penberg@kernel.org>
Thu, 30 Aug 2012 10:13:36 +0000 (13:13 +0300)
cache_grow() can reenable irqs so the cpu (and node) can change, so ensure
that we take list_lock on the correct nodelist.

Fixes an issue with 072bb0aa5e0 ("mm: sl[au]b: add knowledge of PFMEMALLOC
reserve pages") where list_lock for the wrong node was taken after growing
the cache.

Reported-and-tested-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slab.c

index f8b0d539b4822af7812c8f9edcb51224450f3f64..811af03a14ef168ca8e6ba90ec0af60b2dffa305 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3260,6 +3260,7 @@ force_grow:
 
                /* cache_grow can reenable interrupts, then ac could change. */
                ac = cpu_cache_get(cachep);
+               node = numa_mem_id();
 
                /* no objects in sight? abort */
                if (!x && (ac->avail == 0 || force_refill))