aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2018-03-12 15:41:16 +0100
committerRickard Green <[email protected]>2018-03-13 18:32:43 +0100
commitd0573e3e497337e13f4685de4b455817dfb601b7 (patch)
tree4a356e7d6d661295ee4c6d0e16a1d1ecb22edf37
parent13c6a4bf01d39a5002e09ef1f82619cde9f2c90c (diff)
downloadotp-d0573e3e497337e13f4685de4b455817dfb601b7.tar.gz
otp-d0573e3e497337e13f4685de4b455817dfb601b7.tar.bz2
otp-d0573e3e497337e13f4685de4b455817dfb601b7.zip
Reschedule on ordinary scheduler if dirty work is gone
-rw-r--r--erts/emulator/beam/erl_process.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 63e9275ac1..bcf68e80ba 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -10816,6 +10816,10 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
p->scheduler_data = esdp;
}
else {
+ if (!(state & ERTS_PSFLGS_DIRTY_WORK)) {
+ /* Dirty work completed... */
+ goto sunlock_sched_out_proc;
+ }
if (state & (ERTS_PSFLG_ACTIVE_SYS
| ERTS_PSFLG_PENDING_EXIT
| ERTS_PSFLG_EXITING)) {
@@ -10966,6 +10970,23 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
ERTS_PTMR_CLEAR(p);
}
+#ifdef DEBUG
+ if (is_normal_sched) {
+ if (state & ERTS_PSFLGS_DIRTY_WORK)
+ ERTS_INTERNAL_ERROR("Executing dirty code on normal scheduler");
+ }
+ else {
+ if (!(state & ERTS_PSFLGS_DIRTY_WORK)) {
+ if (esdp->type == ERTS_SCHED_DIRTY_CPU)
+ ERTS_INTERNAL_ERROR("Executing normal code on dirty CPU scheduler");
+ else if (esdp->type == ERTS_SCHED_DIRTY_IO)
+ ERTS_INTERNAL_ERROR("Executing normal code on dirty IO scheduler");
+ else
+ ERTS_INTERNAL_ERROR("Executing normal code on dirty UNKNOWN scheduler");
+ }
+ }
+#endif
+
return p;
}
}