sched/fair: Compile out NUMA code entirely when NUMA is disabled
Scheduler code is very hot and every little optimization counts. Instead of constantly checking sched_numa_balancing when NUMA is disabled, compile it out. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
parent
d4b05cdad5
commit
419052d8e5
1 changed files with 4 additions and 2 deletions
|
@ -2655,7 +2655,8 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags)
|
|||
struct numa_group *ng;
|
||||
int priv;
|
||||
|
||||
if (!static_branch_likely(&sched_numa_balancing))
|
||||
if (!IS_ENABLED(CONFIG_NUMA_BALANCING) ||
|
||||
!static_branch_likely(&sched_numa_balancing))
|
||||
return;
|
||||
|
||||
/* for example, ksmd faulting in a user's mm */
|
||||
|
@ -11144,7 +11145,8 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
|
|||
entity_tick(cfs_rq, se, queued);
|
||||
}
|
||||
|
||||
if (static_branch_unlikely(&sched_numa_balancing))
|
||||
if (IS_ENABLED(CONFIG_NUMA_BALANCING) &&
|
||||
static_branch_unlikely(&sched_numa_balancing))
|
||||
task_tick_numa(rq, curr);
|
||||
|
||||
update_misfit_status(curr, rq);
|
||||
|
|
Loading…
Reference in a new issue