aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2006-03-24 06:16:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:24 -0500
commitb2455396be35383c4eebc6745cc718b1dd9e23df (patch)
tree9ed4d43f1ca944c23372fad6554508f1747f5e2d /mm/slab.c
parent151a44202d097ae8b1bbaa6d8d2f97df30e3cd1e (diff)
[PATCH] cpuset: memory_spread_slab drop useless PF_SPREAD_PAGE check
The hook in the slab cache allocation path to handle cpuset memory spreading for tasks in cpusets with 'memory_spread_slab' enabled has a modest performance bug. The hook calls into the memory spreading handler alternate_node_alloc() if either of 'memory_spread_slab' or 'memory_spread_page' is enabled, even though the handler does nothing (albeit harmlessly) for the page case Fix - drop PF_SPREAD_PAGE from the set of flag bits that are used to trigger a call to alternate_node_alloc(). The page case is handled by separate hooks -- see the calls conditioned on cpuset_do_page_mem_spread() in mm/filemap.c Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c
index f80b52388a12..26138c9f8f00 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2809,8 +2809,7 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
2809 struct array_cache *ac; 2809 struct array_cache *ac;
2810 2810
2811#ifdef CONFIG_NUMA 2811#ifdef CONFIG_NUMA
2812 if (unlikely(current->flags & (PF_SPREAD_PAGE | PF_SPREAD_SLAB | 2812 if (unlikely(current->flags & (PF_SPREAD_SLAB | PF_MEMPOLICY))) {
2813 PF_MEMPOLICY))) {
2814 objp = alternate_node_alloc(cachep, flags); 2813 objp = alternate_node_alloc(cachep, flags);
2815 if (objp != NULL) 2814 if (objp != NULL)
2816 return objp; 2815 return objp;
@@ -2849,7 +2848,7 @@ static __always_inline void *__cache_alloc(struct kmem_cache *cachep,
2849 2848
2850#ifdef CONFIG_NUMA 2849#ifdef CONFIG_NUMA
2851/* 2850/*
2852 * Try allocating on another node if PF_SPREAD_PAGE|PF_SPREAD_SLAB|PF_MEMPOLICY. 2851 * Try allocating on another node if PF_SPREAD_SLAB|PF_MEMPOLICY.
2853 * 2852 *
2854 * If we are in_interrupt, then process context, including cpusets and 2853 * If we are in_interrupt, then process context, including cpusets and
2855 * mempolicy, may not apply and should not be used for allocation policy. 2854 * mempolicy, may not apply and should not be used for allocation policy.