aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 8fbb2fd70b64..bd4a9e942ace 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2062,7 +2062,7 @@ init_kmem_cache_node(struct kmem_cache_node *n, struct kmem_cache *s)
2062#endif 2062#endif
2063} 2063}
2064 2064
2065static DEFINE_PER_CPU(struct kmem_cache_cpu, kmalloc_percpu[SLUB_PAGE_SHIFT]); 2065static DEFINE_PER_CPU(struct kmem_cache_cpu, kmalloc_percpu[KMALLOC_CACHES]);
2066 2066
2067static inline int alloc_kmem_cache_cpus(struct kmem_cache *s, gfp_t flags) 2067static inline int alloc_kmem_cache_cpus(struct kmem_cache *s, gfp_t flags)
2068{ 2068{
@@ -2148,7 +2148,8 @@ static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags)
2148 int node; 2148 int node;
2149 int local_node; 2149 int local_node;
2150 2150
2151 if (slab_state >= UP) 2151 if (slab_state >= UP && (s < kmalloc_caches ||
2152 s > kmalloc_caches + KMALLOC_CACHES))
2152 local_node = page_to_nid(virt_to_page(s)); 2153 local_node = page_to_nid(virt_to_page(s));
2153 else 2154 else
2154 local_node = 0; 2155 local_node = 0;