Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Paul Jackson and committed by
Linus Torvalds
b2455396 151a4420

+2 -3
+2 -3
mm/slab.c
··· 2809 2809 struct array_cache *ac; 2810 2810 2811 2811 #ifdef CONFIG_NUMA 2812 - if (unlikely(current->flags & (PF_SPREAD_PAGE | PF_SPREAD_SLAB | 2813 - PF_MEMPOLICY))) { 2812 + if (unlikely(current->flags & (PF_SPREAD_SLAB | PF_MEMPOLICY))) { 2814 2813 objp = alternate_node_alloc(cachep, flags); 2815 2814 if (objp != NULL) 2816 2815 return objp; ··· 2848 2849 2849 2850 #ifdef CONFIG_NUMA 2850 2851 /* 2851 - * Try allocating on another node if PF_SPREAD_PAGE|PF_SPREAD_SLAB|PF_MEMPOLICY. 2852 + * Try allocating on another node if PF_SPREAD_SLAB|PF_MEMPOLICY. 2852 2853 * 2853 2854 * If we are in_interrupt, then process context, including cpusets and 2854 2855 * mempolicy, may not apply and should not be used for allocation policy.