aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-06-04 10:17:17 +0200
committerLukas Larsson <[email protected]>2018-06-04 10:17:17 +0200
commitf4344965e7ceb71856277d74e25a9a871e5a0c9c (patch)
tree82d1f9caec4bef55630d388c3d2430fa5fa5f9be /erts
parentd2ff90ccc987755653dc129b0e96b0d11b669cd5 (diff)
parent4ac9aa587aa0091162e2520fbf9285ade6e8b74e (diff)
downloadotp-f4344965e7ceb71856277d74e25a9a871e5a0c9c.tar.gz
otp-f4344965e7ceb71856277d74e25a9a871e5a0c9c.tar.bz2
otp-f4344965e7ceb71856277d74e25a9a871e5a0c9c.zip
Merge branch 'lukas/erts/fix-scheduler-data-sched-out-bug/OTP-13123'
* lukas/erts/fix-scheduler-data-sched-out-bug/OTP-13123: erts: Make sure scheduler_data is set
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_process.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 1478b71195..8253ec4f40 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -9186,6 +9186,7 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
internal_sched_out_proc:
ERTS_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
+ ASSERT(p->scheduler_data || ERTS_SCHEDULER_IS_DIRTY(esdp));
ASSERT(actual_reds >= 0);
if (reds < ERTS_PROC_MIN_CONTEXT_SWITCH_REDS_COST)
@@ -9618,6 +9619,8 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
state = erts_atomic32_read_nob(&p->state);
if (is_normal_sched) {
+ ASSERT(!p->scheduler_data);
+ p->scheduler_data = esdp;
if ((!!(state & ERTS_PSFLGS_DIRTY_WORK))
& (!(state & ERTS_PSFLG_ACTIVE_SYS))) {
/* Migrate to dirty scheduler... */
@@ -9625,8 +9628,6 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
erts_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
goto sched_out_proc;
}
- ASSERT(!p->scheduler_data);
- p->scheduler_data = esdp;
}
else {
if (!(state & ERTS_PSFLGS_DIRTY_WORK)) {