aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-06-27 10:01:30 +0200
committerJohn Högberg <[email protected]>2018-06-27 13:08:00 +0200
commit70dec3aa35165ff0d6ec3cb792ac2b662349a7c2 (patch)
tree69303be2ea2c6c1ce80303bc8ee42191349589ce
parenta09907d56e29b24ded9a34de82bceac7f39021d1 (diff)
downloadotp-70dec3aa35165ff0d6ec3cb792ac2b662349a7c2.tar.gz
otp-70dec3aa35165ff0d6ec3cb792ac2b662349a7c2.tar.bz2
otp-70dec3aa35165ff0d6ec3cb792ac2b662349a7c2.zip
Move to a dirty scheduler even when we have pending system tasks
When a system task was enqueued on a process between being scheduled and the check altered in this commit, we'd run dirty code on a normal scheduler as the RUNNING_SYS flag wasn't set and we wouldn't migrate back. This change migrates us to a dirty scheduler instead, which will immediately bounce us back to a normal scheduler where RUNNING_SYS will be set appropriately. This is caught fairly reliably by process_SUITE:system_task_failed_enqueue on machines with a lot of cores.
-rw-r--r--erts/emulator/beam/erl_process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 8253ec4f40..173bd98b2f 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -9622,7 +9622,7 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
ASSERT(!p->scheduler_data);
p->scheduler_data = esdp;
if ((!!(state & ERTS_PSFLGS_DIRTY_WORK))
- & (!(state & ERTS_PSFLG_ACTIVE_SYS))) {
+ & (!(state & ERTS_PSFLG_RUNNING_SYS))) {
/* Migrate to dirty scheduler... */
sunlock_sched_out_proc:
erts_proc_unlock(p, ERTS_PROC_LOCK_STATUS);