浏览代码

[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>
Paul Jackson 19 年之前
父节点
当前提交
b2455396be
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      mm/slab.c

+ 2 - 3
mm/slab.c

@@ -2809,8 +2809,7 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 	struct array_cache *ac;
 	struct array_cache *ac;
 
 
 #ifdef CONFIG_NUMA
 #ifdef CONFIG_NUMA
-	if (unlikely(current->flags & (PF_SPREAD_PAGE | PF_SPREAD_SLAB |
-							PF_MEMPOLICY))) {
+	if (unlikely(current->flags & (PF_SPREAD_SLAB | PF_MEMPOLICY))) {
 		objp = alternate_node_alloc(cachep, flags);
 		objp = alternate_node_alloc(cachep, flags);
 		if (objp != NULL)
 		if (objp != NULL)
 			return objp;
 			return objp;
@@ -2849,7 +2848,7 @@ static __always_inline void *__cache_alloc(struct kmem_cache *cachep,
 
 
 #ifdef CONFIG_NUMA
 #ifdef CONFIG_NUMA
 /*
 /*
- * Try allocating on another node if PF_SPREAD_PAGE|PF_SPREAD_SLAB|PF_MEMPOLICY.
+ * Try allocating on another node if PF_SPREAD_SLAB|PF_MEMPOLICY.
  *
  *
  * If we are in_interrupt, then process context, including cpusets and
  * If we are in_interrupt, then process context, including cpusets and
  * mempolicy, may not apply and should not be used for allocation policy.
  * mempolicy, may not apply and should not be used for allocation policy.