Skip to content

Commit

Permalink
Revert "sched/fair: Introduce SIS_CURRENT to wake up short task on cu…
Browse files Browse the repository at this point in the history
…rrent CPU"

This reverts commit 3a096df.
  • Loading branch information
xanmod committed May 2, 2023
1 parent ae4466a commit 60f39d4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
46 changes: 0 additions & 46 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -6397,46 +6397,6 @@ static int wake_wide(struct task_struct *p)
return 1;
}

/*
* Wake up the task on current CPU, if the following conditions are met:
*
* 1. waker A is the only running task on this_cpu
* 3. A is a short duration task (waker will fall asleep soon)
* 4. wakee B is a short duration task (impact of B on A is minor)
* 5. A and B wake up each other alternately
*/
static bool
wake_on_current(int this_cpu, struct task_struct *p)
{
if (!sched_feat(SIS_CURRENT))
return false;

if (cpu_rq(this_cpu)->nr_running > 1)
return false;

/*
* If a task switches in and then voluntarily relinquishes the
* CPU quickly, it is regarded as a short duration task. In that
* way, the short waker is likely to relinquish the CPU soon, which
* provides room for the wakee. Meanwhile, a short wakee would bring
* minor impact to the target rq. Put the short waker and wakee together
* bring benefit to cache-share task pairs and avoid migration overhead.
*/
if (!current->se.dur_avg || ((current->se.dur_avg * 8) >= sysctl_sched_min_granularity))
return false;

if (!p->se.dur_avg || ((p->se.dur_avg * 8) >= sysctl_sched_min_granularity))
return false;

if (current->wakee_flips || p->wakee_flips)
return false;

if (current->last_wakee != p || p->last_wakee != current)
return false;

return true;
}

/*
* The purpose of wake_affine() is to quickly determine on which CPU we can run
* soonest. For the purpose of speed we only consider the waking and previous
Expand Down Expand Up @@ -6530,9 +6490,6 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p,
if (sched_feat(WA_WEIGHT) && target == nr_cpumask_bits)
target = wake_affine_weight(sd, p, this_cpu, prev_cpu, sync);

if (target == nr_cpumask_bits && wake_on_current(this_cpu, p))
target = this_cpu;

schedstat_inc(p->stats.nr_wakeups_affine_attempts);
if (target == nr_cpumask_bits)
return prev_cpu;
Expand Down Expand Up @@ -7033,9 +6990,6 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
}
}

if (smp_processor_id() == target && wake_on_current(target, p))
return target;

i = select_idle_cpu(p, sd, has_idle_core, target);
if ((unsigned)i < nr_cpumask_bits)
return i;
Expand Down
1 change: 0 additions & 1 deletion kernel/sched/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ SCHED_FEAT(TTWU_QUEUE, true)
*/
SCHED_FEAT(SIS_PROP, false)
SCHED_FEAT(SIS_UTIL, true)
SCHED_FEAT(SIS_CURRENT, true)

/*
* Issue a WARN when we do multiple update_rq_clock() calls
Expand Down

0 comments on commit 60f39d4

Please sign in to comment.