Skip to content

Commit

Permalink
sched/fair: Dissociate wakeup decisions from SD flag value
Browse files Browse the repository at this point in the history
The CFS wakeup code will only ever go through EAS / its fast path on
"regular" wakeups (i.e. not on forks or execs). These are currently gated
by a check against 'sd_flag', which would be SD_BALANCE_WAKE at wakeup.

However, we now have a flag that explicitly tells us whether a wakeup is a
"regular" one, so hinge those conditions on that flag instead.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20201102184514.2733-4-valentin.schneider@arm.com
  • Loading branch information
Valentin Schneider authored and Peter Zijlstra committed Nov 10, 2020
1 parent 3aef155 commit dc824eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -6705,7 +6705,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
/* SD_flags and WF_flags share the first nibble */
int sd_flag = wake_flags & 0xF;

if (sd_flag & SD_BALANCE_WAKE) {
if (wake_flags & WF_TTWU) {
record_wakee(p);

if (sched_energy_enabled()) {
Expand Down Expand Up @@ -6742,9 +6742,8 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
if (unlikely(sd)) {
/* Slow path */
new_cpu = find_idlest_cpu(sd, p, cpu, prev_cpu, sd_flag);
} else if (sd_flag & SD_BALANCE_WAKE) { /* XXX always ? */
} else if (wake_flags & WF_TTWU) { /* XXX always ? */
/* Fast path */

new_cpu = select_idle_sibling(p, prev_cpu, new_cpu);

if (want_affine)
Expand Down

0 comments on commit dc824eb

Please sign in to comment.