diff options
author | Christoph Lameter <cl@linux.com> | 2012-05-09 11:09:52 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-06-01 02:25:40 -0400 |
commit | 507effeaba29bf724dfe38317fbd11d0fe25fa40 (patch) | |
tree | 9e877eb0285c9fab8f7248d4157b799a7c980b4b /mm/slub.c | |
parent | 6faa68337b0c90923a1405ae9c196cee64921b7e (diff) |
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2245,6 +2245,12 @@ redo: | |||
2245 | stat(s, ALLOC_REFILL); | 2245 | stat(s, ALLOC_REFILL); |
2246 | 2246 | ||
2247 | load_freelist: | 2247 | load_freelist: |
2248 | /* | ||
2249 | * freelist is pointing to the list of objects to be used. | ||
2250 | * page is pointing to the page from which the objects are obtained. | ||
2251 | * That page must be frozen for per cpu allocations to work. | ||
2252 | */ | ||
2253 | VM_BUG_ON(!c->page->frozen); | ||
2248 | c->freelist = get_freepointer(s, freelist); | 2254 | c->freelist = get_freepointer(s, freelist); |
2249 | c->tid = next_tid(c->tid); | 2255 | c->tid = next_tid(c->tid); |
2250 | local_irq_restore(flags); | 2256 | local_irq_restore(flags); |