diff options
author | Vlastimil Babka <vbabka@suse.cz> | 2021-05-11 16:56:09 +0200 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2021-09-04 01:12:21 +0200 |
commit | 9f101ee89465e0b2c11b477f5b55e03039b2c308 (patch) | |
tree | 5876bc3dfb53494044222f757abae0fda263198f /mm | |
parent | 3f2b77e35a4fc3c83132a1a1a2fc7a2c803a2514 (diff) | |
download | linux-stable-9f101ee89465e0b2c11b477f5b55e03039b2c308.tar.gz linux-stable-9f101ee89465e0b2c11b477f5b55e03039b2c308.tar.bz2 linux-stable-9f101ee89465e0b2c11b477f5b55e03039b2c308.zip |
mm, slub: check new pages with restored irqs
Building on top of the previous patch, re-enable irqs before checking new
pages. alloc_debug_processing() is now called with enabled irqs so we need to
remove VM_BUG_ON(!irqs_disabled()); in check_slab() - there doesn't seem to be
a need for it anyway.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/slub.c b/mm/slub.c index a5e974defcb7..b5788040d92e 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1009,8 +1009,6 @@ static int check_slab(struct kmem_cache *s, struct page *page) { int maxobj; - VM_BUG_ON(!irqs_disabled()); - if (!PageSlab(page)) { slab_err(s, page, "Not a valid slab page"); return 0; @@ -2802,10 +2800,10 @@ new_objects: lockdep_assert_irqs_disabled(); freelist = get_partial(s, gfpflags, node, &page); + local_irq_restore(flags); if (freelist) goto check_new_page; - local_irq_restore(flags); put_cpu_ptr(s->cpu_slab); page = new_slab(s, gfpflags, node); c = get_cpu_ptr(s->cpu_slab); @@ -2815,7 +2813,6 @@ new_objects: return NULL; } - local_irq_save(flags); /* * No other reference to the page yet so we can * muck around with it freely without cmpxchg @@ -2830,7 +2827,6 @@ check_new_page: if (kmem_cache_debug(s)) { if (!alloc_debug_processing(s, page, freelist, addr)) { /* Slab failed checks. Next slab needed */ - local_irq_restore(flags); goto new_slab; } else { /* @@ -2848,6 +2844,7 @@ check_new_page: */ goto return_single; + local_irq_save(flags); if (unlikely(c->page)) flush_slab(s, c); c->page = page; @@ -2856,6 +2853,7 @@ check_new_page: return_single: + local_irq_save(flags); if (unlikely(c->page)) flush_slab(s, c); c->page = page; |