Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #167 from sched-ext/select_dfl_wake_sync
Browse files Browse the repository at this point in the history
scx: Update conditions for WAKE_SYNC migration
  • Loading branch information
Byte-Lab authored Mar 28, 2024
2 parents fc86083 + 83e31d6 commit 2fc287e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2084,12 +2084,18 @@ static s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu,
}

/*
* If WAKE_SYNC and the machine isn't fully saturated, wake up @p to the
* local DSQ of the waker.
* If WAKE_SYNC, the waker's local DSQ is empty, and the system is
* under utilized, wake up @p to the local DSQ of the waker. Checking
* only for an empty local DSQ is insufficient as it could give the
* wakee an unfair advantage when the system is oversaturated.
* Checking only for the presence of idle CPUs is also insufficient as
* the local DSQ of the waker could have tasks piled up on it even if
* there is an idle core elsewhere on the system.
*/
cpu = smp_processor_id();
if ((wake_flags & SCX_WAKE_SYNC) && p->nr_cpus_allowed > 1 &&
!cpumask_empty(idle_masks.cpu) && !(current->flags & PF_EXITING)) {
cpu = smp_processor_id();
!cpumask_empty(idle_masks.cpu) && !(current->flags & PF_EXITING) &&
cpu_rq(cpu)->scx.local_dsq.nr == 0) {
if (cpumask_test_cpu(cpu, p->cpus_ptr))
goto cpu_found;
}
Expand Down

0 comments on commit 2fc287e

Please sign in to comment.