mm: page_alloc: use jump labels to avoid checking number_of_cpusets
If cpusets are not in use then we still check a global variable on every page allocation. Use jump labels to avoid the overhead. Signed-off-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Jan Kara <jack@suse.cz> Cc: Michal Hocko <mhocko@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Theodore Ts'o <tytso@mit.edu> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
ea5e9539ab
commit
664eeddeef
@@ -1921,7 +1921,8 @@ zonelist_scan:
|
||||
if (IS_ENABLED(CONFIG_NUMA) && zlc_active &&
|
||||
!zlc_zone_worth_trying(zonelist, z, allowednodes))
|
||||
continue;
|
||||
if ((alloc_flags & ALLOC_CPUSET) &&
|
||||
if (cpusets_enabled() &&
|
||||
(alloc_flags & ALLOC_CPUSET) &&
|
||||
!cpuset_zone_allowed_softwall(zone, gfp_mask))
|
||||
continue;
|
||||
BUILD_BUG_ON(ALLOC_NO_WATERMARKS < NR_WMARK);
|
||||
|
Reference in New Issue
Block a user