diff options
author | Christoph Lameter <cl@linux.com> | 2012-11-28 11:23:00 -0500 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-12-11 05:14:27 -0500 |
commit | 59a09917c95e5209135b4f1a87f1263d6ef40fdb (patch) | |
tree | 027e7cf5f292e4e811745505e1627b0c353d5594 /mm/slub.c | |
parent | a755b76ab4cefe3d3aa046f3abc62b7e087336b3 (diff) |
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: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1869,12 +1869,14 @@ redo: | |||
1869 | /* | 1869 | /* |
1870 | * Unfreeze all the cpu partial slabs. | 1870 | * Unfreeze all the cpu partial slabs. |
1871 | * | 1871 | * |
1872 | * This function must be called with interrupt disabled. | 1872 | * This function must be called with interrupts disabled |
1873 | * for the cpu using c (or some other guarantee must be there | ||
1874 | * to guarantee no concurrent accesses). | ||
1873 | */ | 1875 | */ |
1874 | static void unfreeze_partials(struct kmem_cache *s) | 1876 | static void unfreeze_partials(struct kmem_cache *s, |
1877 | struct kmem_cache_cpu *c) | ||
1875 | { | 1878 | { |
1876 | struct kmem_cache_node *n = NULL, *n2 = NULL; | 1879 | struct kmem_cache_node *n = NULL, *n2 = NULL; |
1877 | struct kmem_cache_cpu *c = this_cpu_ptr(s->cpu_slab); | ||
1878 | struct page *page, *discard_page = NULL; | 1880 | struct page *page, *discard_page = NULL; |
1879 | 1881 | ||
1880 | while ((page = c->partial)) { | 1882 | while ((page = c->partial)) { |
@@ -1960,7 +1962,7 @@ static int put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) | |||
1960 | * set to the per node partial list. | 1962 | * set to the per node partial list. |
1961 | */ | 1963 | */ |
1962 | local_irq_save(flags); | 1964 | local_irq_save(flags); |
1963 | unfreeze_partials(s); | 1965 | unfreeze_partials(s, this_cpu_ptr(s->cpu_slab)); |
1964 | local_irq_restore(flags); | 1966 | local_irq_restore(flags); |
1965 | oldpage = NULL; | 1967 | oldpage = NULL; |
1966 | pobjects = 0; | 1968 | pobjects = 0; |
@@ -2003,7 +2005,7 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu) | |||
2003 | if (c->page) | 2005 | if (c->page) |
2004 | flush_slab(s, c); | 2006 | flush_slab(s, c); |
2005 | 2007 | ||
2006 | unfreeze_partials(s); | 2008 | unfreeze_partials(s, c); |
2007 | } | 2009 | } |
2008 | } | 2010 | } |
2009 | 2011 | ||