Commit 59a09917 authored by Christoph Lameter's avatar Christoph Lameter Committed by Pekka Enberg

slub: Use correct cpu_slab on dead cpu

Pass a kmem_cache_cpu pointer into unfreeze partials so that a different
kmem_cache_cpu structure than the local one can be specified.
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent a755b76a
...@@ -1869,12 +1869,14 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, void *freel ...@@ -1869,12 +1869,14 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, void *freel
/* /*
* Unfreeze all the cpu partial slabs. * Unfreeze all the cpu partial slabs.
* *
* This function must be called with interrupt disabled. * This function must be called with interrupts disabled
* for the cpu using c (or some other guarantee must be there
* to guarantee no concurrent accesses).
*/ */
static void unfreeze_partials(struct kmem_cache *s) static void unfreeze_partials(struct kmem_cache *s,
struct kmem_cache_cpu *c)
{ {
struct kmem_cache_node *n = NULL, *n2 = NULL; struct kmem_cache_node *n = NULL, *n2 = NULL;
struct kmem_cache_cpu *c = this_cpu_ptr(s->cpu_slab);
struct page *page, *discard_page = NULL; struct page *page, *discard_page = NULL;
while ((page = c->partial)) { while ((page = c->partial)) {
...@@ -1960,7 +1962,7 @@ static int put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) ...@@ -1960,7 +1962,7 @@ static int put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
* set to the per node partial list. * set to the per node partial list.
*/ */
local_irq_save(flags); local_irq_save(flags);
unfreeze_partials(s); unfreeze_partials(s, this_cpu_ptr(s->cpu_slab));
local_irq_restore(flags); local_irq_restore(flags);
oldpage = NULL; oldpage = NULL;
pobjects = 0; pobjects = 0;
...@@ -2003,7 +2005,7 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu) ...@@ -2003,7 +2005,7 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu)
if (c->page) if (c->page)
flush_slab(s, c); flush_slab(s, c);
unfreeze_partials(s); unfreeze_partials(s, c);
} }
} }
......
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