Skip to content

Commit 19d9bd5

Browse files
jpsamarookrynju
andcommitted
Only reschedule on negative pressure changes
Co-authored-by: krynju <[email protected]>
1 parent 118f608 commit 19d9bd5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/sch/eager.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,24 @@ 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, proctype::Type, pressure)
3839
uid = Dagger.get_tls().sch_uid
3940
lock(TASK_SYNC) do
4041
PROC_UTILIZATION[uid][proctype][] += pressure
41-
notify(TASK_SYNC)
42+
if pressure < 0
43+
notify(TASK_SYNC)
44+
end
4245
end
4346
exec!(_adjust_pressure!, h, myid(), proctype, pressure)
4447
end
4548
function _adjust_pressure!(ctx, state, task, tid, (pid, proctype, pressure))
4649
state.worker_pressure[pid][proctype] += pressure
47-
put!(state.chan, RescheduleSignal())
50+
if pressure < 0
51+
put!(state.chan, RescheduleSignal())
52+
end
4853
nothing
4954
end
5055

0 commit comments

Comments
 (0)