Skip to content

Commit 91ba229

Browse files
jpsamarookrynju
andcommitted
Only reschedule on negative pressure changes
Co-authored-by: krynju <[email protected]>
1 parent c288701 commit 91ba229

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/sch/eager.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ function init_eager()
3232
end
3333
end
3434

35-
"Adjusts the scheduler's cached pressure indicator for the specified worker by
36-
the specified amount."
35+
"Adjusts the scheduler's cached pressure indicators for the specified worker by
36+
the specified amount, and signals the scheduler to try scheduling again if
37+
pressure decreased."
3738
function adjust_pressure!(h::SchedulerHandle, proc::Processor, pressure)
3839
uid = Dagger.get_tls().sch_uid
3940
lock(TASK_SYNC) do
@@ -44,7 +45,9 @@ function adjust_pressure!(h::SchedulerHandle, proc::Processor, pressure)
4445
end
4546
function _adjust_pressure!(ctx, state, task, tid, (pid, proc, pressure))
4647
state.worker_pressure[pid][proc] += pressure
47-
put!(state.chan, RescheduleSignal())
48+
if pressure < 0
49+
put!(state.chan, RescheduleSignal())
50+
end
4851
nothing
4952
end
5053

0 commit comments

Comments
 (0)