diff options
author | David Rientjes <rientjes@google.com> | 2012-07-09 17:00:38 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-07-10 15:43:52 -0400 |
commit | 737b719ed6569ffcd015fcdf3039dc7af47af877 (patch) | |
tree | 4a756eb46d499376763263e235568365049f06bc /mm/slub.c | |
parent | 20cea9683ecc6dd75a80c0dd02dc69c64e95be75 (diff) |
mm, slub: ensure irqs are enabled for kmemcheck
kmemcheck_alloc_shadow() requires irqs to be enabled, so wait to disable
them until after its called for __GFP_WAIT allocations.
This fixes a warning for such allocations:
WARNING: at kernel/lockdep.c:2739 lockdep_trace_alloc+0x14e/0x1c0()
Acked-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1299,13 +1299,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) | |||
1299 | stat(s, ORDER_FALLBACK); | 1299 | stat(s, ORDER_FALLBACK); |
1300 | } | 1300 | } |
1301 | 1301 | ||
1302 | if (flags & __GFP_WAIT) | 1302 | if (kmemcheck_enabled && page |
1303 | local_irq_disable(); | ||
1304 | |||
1305 | if (!page) | ||
1306 | return NULL; | ||
1307 | |||
1308 | if (kmemcheck_enabled | ||
1309 | && !(s->flags & (SLAB_NOTRACK | DEBUG_DEFAULT_FLAGS))) { | 1303 | && !(s->flags & (SLAB_NOTRACK | DEBUG_DEFAULT_FLAGS))) { |
1310 | int pages = 1 << oo_order(oo); | 1304 | int pages = 1 << oo_order(oo); |
1311 | 1305 | ||
@@ -1321,6 +1315,11 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) | |||
1321 | kmemcheck_mark_unallocated_pages(page, pages); | 1315 | kmemcheck_mark_unallocated_pages(page, pages); |
1322 | } | 1316 | } |
1323 | 1317 | ||
1318 | if (flags & __GFP_WAIT) | ||
1319 | local_irq_disable(); | ||
1320 | if (!page) | ||
1321 | return NULL; | ||
1322 | |||
1324 | page->objects = oo_objects(oo); | 1323 | page->objects = oo_objects(oo); |
1325 | mod_zone_page_state(page_zone(page), | 1324 | mod_zone_page_state(page_zone(page), |
1326 | (s->flags & SLAB_RECLAIM_ACCOUNT) ? | 1325 | (s->flags & SLAB_RECLAIM_ACCOUNT) ? |