aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2018-03-07 16:27:53 +0100
committerRickard Green <[email protected]>2018-03-07 16:27:53 +0100
commit9bc4a096025254aed157e4753743be61ce1f7489 (patch)
tree07da445103b0ee55c06b9764c9b55655b968a099
parent249549e8102d68ab086c418fa93494906c4445d0 (diff)
parent9ef6b9a923b25ceb487eea4431cdf730972fc489 (diff)
downloadotp-9bc4a096025254aed157e4753743be61ce1f7489.tar.gz
otp-9bc4a096025254aed157e4753743be61ce1f7489.tar.bz2
otp-9bc4a096025254aed157e4753743be61ce1f7489.zip
Merge branch 'rickard/psflgs-fix/OTP-14948'
* rickard/psflgs-fix/OTP-14948: Fix for bug introduced when replacing ERTS_PSFLG_BOUND
-rw-r--r--erts/emulator/beam/erl_process.c17
-rw-r--r--erts/emulator/beam/erl_process.h1
2 files changed, 10 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index b19659f496..23fe353495 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -4135,8 +4135,6 @@ evacuate_run_queue(ErtsRunQueue *rq,
for (prio_q = 0; prio_q < ERTS_NO_PROC_PRIO_QUEUES; prio_q++) {
erts_aint32_t state;
Process *proc;
- int notify = 0;
- to_rq = NULL;
if (!mp->prio[prio_q].runq)
return;
@@ -4195,6 +4193,12 @@ evacuate_run_queue(ErtsRunQueue *rq,
goto handle_next_proc;
}
+ prio = (int) ERTS_PSFLGS_GET_PRQ_PRIO(state);
+ to_rq = mp->prio[prio].runq;
+
+ if (!to_rq)
+ goto handle_next_proc;
+
if (!erts_try_change_runq_proc(proc, to_rq)) {
/* Bound processes get stuck here... */
proc->next = NULL;
@@ -4205,15 +4209,13 @@ evacuate_run_queue(ErtsRunQueue *rq,
sbpp->last = proc;
}
else {
- int prio = (int) ERTS_PSFLGS_GET_PRQ_PRIO(state);
erts_runq_unlock(rq);
- to_rq = mp->prio[prio].runq;
-
erts_runq_lock(to_rq);
enqueue_process(to_rq, prio, proc);
erts_runq_unlock(to_rq);
- notify = 1;
+
+ smp_notify_inc_runq(to_rq);
erts_runq_lock(rq);
}
@@ -4221,8 +4223,7 @@ evacuate_run_queue(ErtsRunQueue *rq,
handle_next_proc:
proc = dequeue_process(rq, prio_q, &state);
}
- if (notify)
- smp_notify_inc_runq(to_rq);
+
}
}
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index e585fabb51..8581c6a639 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -2292,6 +2292,7 @@ erts_set_runq_proc(Process *p, ErtsRunQueue *rq, int *bndp)
{
erts_aint_t rqint = (erts_aint_t) rq;
ASSERT(bndp);
+ ASSERT(rq);
if (*bndp)
rqint |= ERTS_RUNQ_BOUND_FLAG;
rqint = erts_atomic_xchg_nob(&p->run_queue, rqint);