| Date: Tue, 30 Oct 2012 15:29:17 +0000 |
| From: Christoph Lameter <cl@linux.com> |
| Subject: 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. |
| |
| Reported-by: Thomas Gleixner <tglx@linutronix.de> |
| Signed-off-by: Christoph Lameter <cl@linux.com> |
| |
| --- |
| mm/slub.c | 8 ++++---- |
| 1 file changed, 4 insertions(+), 4 deletions(-) |
| |
| Index: linux-stable/mm/slub.c |
| =================================================================== |
| --- linux-stable.orig/mm/slub.c |
| +++ linux-stable/mm/slub.c |
| @@ -1871,10 +1871,10 @@ redo: |
| * |
| * This function must be called with interrupt disabled. |
| */ |
| -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_cpu *c = this_cpu_ptr(s->cpu_slab); |
| struct page *page, *discard_page = NULL; |
| |
| while ((page = c->partial)) { |
| @@ -1960,7 +1960,7 @@ int put_cpu_partial(struct kmem_cache *s |
| * set to the per node partial list. |
| */ |
| local_irq_save(flags); |
| - unfreeze_partials(s); |
| + unfreeze_partials(s, this_cpu_ptr(s->cpu_slab)); |
| local_irq_restore(flags); |
| pobjects = 0; |
| pages = 0; |
| @@ -2002,7 +2002,7 @@ static inline void __flush_cpu_slab(stru |
| if (c->page) |
| flush_slab(s, c); |
| |
| - unfreeze_partials(s); |
| + unfreeze_partials(s, c); |
| } |
| } |
| |