projects/linux·commit 51cd8e6f

mm, slab: lock the correct nodelist after reenabling irqs

51cd8e6f · David Rientjes <[email protected]> · 2012-08-28 19:57:21 -07:00

cache_grow() can reenable irqs so the cpu (and node) can change, so ensure
that we take list_lock on the correct nodelist.

This fixes an issue with commit 072bb0aa5e06 ("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 <[email protected]>
Signed-off-by: David Rientjes <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
51cd8e6ff265650e35e46b5bcbe2ee381a7a2877
Parents
c182ae42

Changes

1 files changed · +1 −0

FileStatusAddDelContent
mm/slab.cmodified+1−0View file

mm/slab.c

View file
diff --git a/mm/slab.c b/mm/slab.c
index f8b0d53..811af03 100644
--- 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))