aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/mm/slab.c b/mm/slab.c
index a467b308c682..7c52b3890d25 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2124,7 +2124,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp)
2124int 2124int
2125__kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) 2125__kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
2126{ 2126{
2127 size_t left_over, freelist_size, ralign; 2127 size_t left_over, freelist_size;
2128 size_t ralign = BYTES_PER_WORD;
2128 gfp_t gfp; 2129 gfp_t gfp;
2129 int err; 2130 int err;
2130 size_t size = cachep->size; 2131 size_t size = cachep->size;
@@ -2157,14 +2158,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
2157 size &= ~(BYTES_PER_WORD - 1); 2158 size &= ~(BYTES_PER_WORD - 1);
2158 } 2159 }
2159 2160
2160 /*
2161 * Redzoning and user store require word alignment or possibly larger.
2162 * Note this will be overridden by architecture or caller mandated
2163 * alignment if either is greater than BYTES_PER_WORD.
2164 */
2165 if (flags & SLAB_STORE_USER)
2166 ralign = BYTES_PER_WORD;
2167
2168 if (flags & SLAB_RED_ZONE) { 2161 if (flags & SLAB_RED_ZONE) {
2169 ralign = REDZONE_ALIGN; 2162 ralign = REDZONE_ALIGN;
2170 /* If redzoning, ensure that the second redzone is suitably 2163 /* If redzoning, ensure that the second redzone is suitably
@@ -2994,7 +2987,7 @@ out:
2994 2987
2995#ifdef CONFIG_NUMA 2988#ifdef CONFIG_NUMA
2996/* 2989/*
2997 * Try allocating on another node if PF_SPREAD_SLAB is a mempolicy is set. 2990 * Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set.
2998 * 2991 *
2999 * If we are in_interrupt, then process context, including cpusets and 2992 * If we are in_interrupt, then process context, including cpusets and
3000 * mempolicy, may not apply and should not be used for allocation policy. 2993 * mempolicy, may not apply and should not be used for allocation policy.
@@ -3226,7 +3219,7 @@ __do_cache_alloc(struct kmem_cache *cache, gfp_t flags)
3226{ 3219{
3227 void *objp; 3220 void *objp;
3228 3221
3229 if (current->mempolicy || unlikely(current->flags & PF_SPREAD_SLAB)) { 3222 if (current->mempolicy || cpuset_do_slab_mem_spread()) {
3230 objp = alternate_node_alloc(cache, flags); 3223 objp = alternate_node_alloc(cache, flags);
3231 if (objp) 3224 if (objp)
3232 goto out; 3225 goto out;