Commit 9f101ee8 authored by Vlastimil Babka's avatar Vlastimil Babka

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: default avatarVlastimil Babka <vbabka@suse.cz>
parent 3f2b77e3
...@@ -1009,8 +1009,6 @@ static int check_slab(struct kmem_cache *s, struct page *page) ...@@ -1009,8 +1009,6 @@ static int check_slab(struct kmem_cache *s, struct page *page)
{ {
int maxobj; int maxobj;
VM_BUG_ON(!irqs_disabled());
if (!PageSlab(page)) { if (!PageSlab(page)) {
slab_err(s, page, "Not a valid slab page"); slab_err(s, page, "Not a valid slab page");
return 0; return 0;
...@@ -2802,10 +2800,10 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -2802,10 +2800,10 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
lockdep_assert_irqs_disabled(); lockdep_assert_irqs_disabled();
freelist = get_partial(s, gfpflags, node, &page); freelist = get_partial(s, gfpflags, node, &page);
local_irq_restore(flags);
if (freelist) if (freelist)
goto check_new_page; goto check_new_page;
local_irq_restore(flags);
put_cpu_ptr(s->cpu_slab); put_cpu_ptr(s->cpu_slab);
page = new_slab(s, gfpflags, node); page = new_slab(s, gfpflags, node);
c = get_cpu_ptr(s->cpu_slab); c = get_cpu_ptr(s->cpu_slab);
...@@ -2815,7 +2813,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -2815,7 +2813,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
return NULL; return NULL;
} }
local_irq_save(flags);
/* /*
* No other reference to the page yet so we can * No other reference to the page yet so we can
* muck around with it freely without cmpxchg * muck around with it freely without cmpxchg
...@@ -2830,7 +2827,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -2830,7 +2827,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
if (kmem_cache_debug(s)) { if (kmem_cache_debug(s)) {
if (!alloc_debug_processing(s, page, freelist, addr)) { if (!alloc_debug_processing(s, page, freelist, addr)) {
/* Slab failed checks. Next slab needed */ /* Slab failed checks. Next slab needed */
local_irq_restore(flags);
goto new_slab; goto new_slab;
} else { } else {
/* /*
...@@ -2848,6 +2844,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -2848,6 +2844,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
*/ */
goto return_single; goto return_single;
local_irq_save(flags);
if (unlikely(c->page)) if (unlikely(c->page))
flush_slab(s, c); flush_slab(s, c);
c->page = page; c->page = page;
...@@ -2856,6 +2853,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -2856,6 +2853,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
return_single: return_single:
local_irq_save(flags);
if (unlikely(c->page)) if (unlikely(c->page))
flush_slab(s, c); flush_slab(s, c);
c->page = page; c->page = page;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment