diff options
author | Rickard Green <[email protected]> | 2018-03-13 18:41:58 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2018-03-13 18:41:58 +0100 |
commit | 348a4e057db36fac13f1551c0a1c17f0d376da48 (patch) | |
tree | da91617626a3793c508ab829d8f19a9b754c7040 /erts/emulator/beam/erl_process.c | |
parent | dfd7a2956a465dccd754243e3b1bf5c24931132e (diff) | |
parent | d0573e3e497337e13f4685de4b455817dfb601b7 (diff) | |
download | otp-348a4e057db36fac13f1551c0a1c17f0d376da48.tar.gz otp-348a4e057db36fac13f1551c0a1c17f0d376da48.tar.bz2 otp-348a4e057db36fac13f1551c0a1c17f0d376da48.zip |
Merge branch 'rickard/dirty-work-gone/OTP-14978'
* rickard/dirty-work-gone/OTP-14978:
Reschedule on ordinary scheduler if dirty work is gone
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r-- | erts/emulator/beam/erl_process.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index d069f62b39..0d02d10ac9 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -10037,6 +10037,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)) { @@ -10179,6 +10183,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; } } |