diff options
| author | Mel Gorman <[email protected]> | 2018-02-13 13:37:25 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2018-02-21 08:49:07 +0100 |
| commit | 7ebb66a12f85bc375beaf45ca900427fe47aa8f7 (patch) | |
| tree | 5587bd35bd91709ab01e52f4ad3dc313081fa90a | |
| parent | ed029343951f9f0c8600a484841c67e6c129717b (diff) | |
sched/fair: Avoid an unnecessary lookup of current CPU ID during wake_affine
The only caller of wake_affine() knows the CPU ID. Pass it in instead of
rechecking it.
Signed-off-by: Mel Gorman <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Giovanni Gherdovich <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Matt Fleming <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
| -rw-r--r-- | kernel/sched/fair.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 820f94c9b200..0132572d7523 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5751,9 +5751,8 @@ wake_affine_weight(struct sched_domain *sd, struct task_struct *p, } static int wake_affine(struct sched_domain *sd, struct task_struct *p, - int prev_cpu, int sync) + int this_cpu, int prev_cpu, int sync) { - int this_cpu = smp_processor_id(); int target = nr_cpumask_bits; if (sched_feat(WA_IDLE)) @@ -6376,7 +6375,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f if (cpu == prev_cpu) goto pick_cpu; - new_cpu = wake_affine(affine_sd, p, prev_cpu, sync); + new_cpu = wake_affine(affine_sd, p, cpu, prev_cpu, sync); } if (sd && !(sd_flag & SD_BALANCE_FORK)) { |