summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErlang/OTP <otp@erlang.org>2020-02-27 11:53:58 +0100
committerErlang/OTP <otp@erlang.org>2020-02-27 11:53:58 +0100
commit377fe6c430700a3b395cacfa0601f8d69415a44f (patch)
tree629c36b8942a68dfa42cd14fdc7020a60bfee048
parent63bd6be692381ac6d62bd4aed79c4488db44055a (diff)
parent258e0e7955f99e49f76bb3a66ab2275cc27e45fd (diff)
downloaderlang-377fe6c430700a3b395cacfa0601f8d69415a44f.tar.gz
Merge branch 'rickard/endless-resched-bug/ERL-1152/OTP-16436' into maint-20
* rickard/endless-resched-bug/ERL-1152/OTP-16436: Prevent endless reschedule of sys-task due to high prio dirty-job # Conflicts: # erts/emulator/test/process_SUITE.erl
-rw-r--r--erts/emulator/beam/erl_process.c8
-rw-r--r--erts/emulator/test/process_SUITE.erl15
2 files changed, 19 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index f78631abb8..3badc56043 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -11155,10 +11155,14 @@ fetch_sys_task(Process *c_p, erts_aint32_t state, int *qmaskp, int *priop)
qmask = c_p->sys_task_qs->qmask;
- if ((state & (ERTS_PSFLG_ACTIVE
+ if ((state & (ERTS_PSFLGS_DIRTY_WORK
+ | ERTS_PSFLG_ACTIVE
| ERTS_PSFLG_EXITING
| ERTS_PSFLG_SUSPENDED)) == ERTS_PSFLG_ACTIVE) {
- /* No sys tasks if we got exclusively higher prio user work to do */
+ /*
+ * No sys tasks if we got exclusively higher prio user work
+ * to do; ignoring dirty work...
+ */
st = NULL;
switch (ERTS_PSFLGS_GET_USR_PRIO(state)) {
case PRIORITY_MAX:
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index 95b0a7194f..d2dd42b222 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -60,7 +60,8 @@
system_task_on_suspended/1,
system_task_failed_enqueue/1,
gc_request_when_gc_disabled/1,
- gc_request_blast_when_gc_disabled/1]).
+ gc_request_blast_when_gc_disabled/1,
+ otp_16436/1]).
-export([prio_server/2, prio_client/2, init/1, handle_event/2]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -106,7 +107,8 @@ groups() ->
{system_task, [],
[no_priority_inversion, no_priority_inversion2,
system_task_blast, system_task_on_suspended, system_task_failed_enqueue,
- gc_request_when_gc_disabled, gc_request_blast_when_gc_disabled]}].
+ gc_request_when_gc_disabled, gc_request_blast_when_gc_disabled,
+ otp_16436]}].
init_per_suite(Config) ->
A0 = case application:start(sasl) of
@@ -2663,6 +2665,15 @@ gc_request_blast_when_gc_disabled(Config) when is_list(Config) ->
receive {'DOWN', M, process, P, _Reason} -> ok end,
ok.
+otp_16436(Config) when is_list(Config) ->
+ P = spawn_opt(fun () ->
+ erts_debug:dirty_io(wait, 1000)
+ end,
+ [{priority,high},link]),
+ erlang:check_process_code(P, non_existing),
+ unlink(P),
+ exit(P, kill),
+ ok.
%% Internal functions