summaryrefslogtreecommitdiff
path: root/mm/slub.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2012-05-09 10:09:52 -0500
committerPekka Enberg <penberg@kernel.org>2012-06-01 09:25:40 +0300
commit507effeaba29bf724dfe38317fbd11d0fe25fa40 (patch)
tree9e877eb0285c9fab8f7248d4157b799a7c980b4b /mm/slub.c
parent6faa68337b0c90923a1405ae9c196cee64921b7e (diff)
downloadlwn-507effeaba29bf724dfe38317fbd11d0fe25fa40.tar.gz
lwn-507effeaba29bf724dfe38317fbd11d0fe25fa40.zip
slub: Add frozen check in __slab_alloc
Verify that objects returned from __slab_alloc come from slab pages in the correct state. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 83f258298de7..a3395c28f561 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2245,6 +2245,12 @@ redo:
stat(s, ALLOC_REFILL);
load_freelist:
+ /*
+ * freelist is pointing to the list of objects to be used.
+ * page is pointing to the page from which the objects are obtained.
+ * That page must be frozen for per cpu allocations to work.
+ */
+ VM_BUG_ON(!c->page->frozen);
c->freelist = get_freepointer(s, freelist);
c->tid = next_tid(c->tid);
local_irq_restore(flags);