aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-10-11 16:27:34 +0200
committerLukas Larsson <[email protected]>2018-10-23 09:58:40 +0200
commit4047f7177835928f2205fb728c65247ea68d5d59 (patch)
treecb99f9cd0f342362b649d6283fcece07d52eec47 /erts
parent090f9543f66cc0c4ea4d1ca63902c300b103f271 (diff)
downloadotp-4047f7177835928f2205fb728c65247ea68d5d59.tar.gz
otp-4047f7177835928f2205fb728c65247ea68d5d59.tar.bz2
otp-4047f7177835928f2205fb728c65247ea68d5d59.zip
erts: Make thr prgr wakeup current or sched 1
Before this change, it was always the aux thread that was woken to handle thread progress events scheduled to happen when all schedulers were going to sleep. This was ok in the pre-OTP-21 implementation when the aux thread just slept on a tse. Now that it sleeps in the fallback pollset this uses too much cpu so instead we wake the thread that is doing the request if it is a managed thread, or else we wake scheduler 1.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_thr_progress.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_thr_progress.c b/erts/emulator/beam/erl_thr_progress.c
index 20b05dc942..bac437efe9 100644
--- a/erts/emulator/beam/erl_thr_progress.c
+++ b/erts/emulator/beam/erl_thr_progress.c
@@ -801,7 +801,7 @@ leader_update(ErtsThrPrgrData *tpd)
== ERTS_THR_PRGR_LFLG_NO_LEADER))
&& got_sched_wakeups()) {
/* Someone need to make progress */
- wakeup_managed(0);
+ wakeup_managed(tpd->id);
}
}
}
@@ -888,7 +888,7 @@ erts_thr_progress_prepare_wait(ErtsThrPrgrData *tpd)
== ERTS_THR_PRGR_LFLG_NO_LEADER
&& got_sched_wakeups()) {
/* Someone need to make progress */
- wakeup_managed(0);
+ wakeup_managed(tpd->id);
}
}
@@ -975,7 +975,7 @@ unmanaged_continue(ErtsThrPrgrDelayHandle handle)
== (ERTS_THR_PRGR_LFLG_NO_LEADER|ERTS_THR_PRGR_LFLG_WAITING_UM)
&& got_sched_wakeups()) {
/* Others waiting for us... */
- wakeup_managed(0);
+ wakeup_managed(1);
}
}
}