Skip to contentSkip to conversation

Cpuset: memory_spread_slab drop useless PF_SPREAD_PAGE check

PATCH New Paul Jackson 1 participant 1 message Mar 19, 2006 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cpuset: memory_spread_slab drop useless PF_SPREAD_PAGE check

From: Paul Jackson <[email protected]>

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

---

 mm/slab.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
mm/slab.c +2 -3
@@ -2835,8 +2835,7 @@ static inline void *____cache_alloc(stru
 	struct array_cache *ac;
 
 #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);
 		if (objp != NULL)
 			return objp;
@@ -2875,7 +2874,7 @@ static __always_inline void *__cache_all
 
 #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
  * mempolicy, may not apply and should not be used for allocation policy.
Signature · 3 lines
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373