Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduling and signal delivery fixes #7822

Conversation

rickard-green
Copy link
Contributor

Fixes #7801

@rickard-green rickard-green added team:VM Assigned to OTP team VM fix testing currently being tested, tag is used by OTP internal CI labels Nov 3, 2023
@rickard-green rickard-green self-assigned this Nov 3, 2023
Copy link
Contributor

github-actions bot commented Nov 3, 2023

CT Test Results

       3 files     140 suites   45m 56s ⏱️
1 565 tests 1 516 ✔️ 49 💤 0
2 073 runs  2 005 ✔️ 68 💤 0

Results for commit 00089cf.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@rickard-green rickard-green force-pushed the rickard/signal-sched-fixes/OTP-18839/OTP-18839/OTP-18841 branch 2 times, most recently from f14a736 to c1f60f7 Compare November 6, 2023 19:14
@rickard-green rickard-green force-pushed the rickard/signal-sched-fixes/OTP-18839/OTP-18839/OTP-18841 branch 4 times, most recently from eb73f32 to 6d5a16a Compare November 14, 2023 15:51
OTP-18838

When fetching signals for a process not in a running state and with parallel
signal enqueue optimization enabled, it could end up being activated but not
inserted into the run queue. If/when this happened the process would be stuck
potentially for ever.

Currently signals are only fetched for processes not in a running state
when: a process that is receive traced is scheduled out, another process is
inspected using process_info(Pid, message_queue_len), and in the break
handler.
OTP-18839

When scheduling a process for dirty execution it could end up not being
inserted into the run queue causing the process to get stuck for ever.
OTP-18841

Commit (1) changed so that signals sent to processes scheduled for dirty
execution didn't trigger rescheduling of such processes to normal schedulers
in order to handle signals, but instead rely on the dirty signal handler
processes to take care of handling the signals for such processes. This
since a steady flow of incoming signals to processes scheduled for dirty
execution caused such processes to bounce between schedulers and could
prevent them from making progress. The dirty signal handler processes did
however not take care of the signals until the receiving processes were
selected for execution. As a result of this, if a process got stuck for a
long time in a dirty run queue due to heavy usage of dirty schedulers, it
took a long time until signals were delivered to such processes. As of this
commit, dirty signal handler processes will also take care of signal handling
for processes in dirty run queues.

(1) 53b1983
@rickard-green rickard-green force-pushed the rickard/signal-sched-fixes/OTP-18839/OTP-18839/OTP-18841 branch from 6d5a16a to 00089cf Compare November 21, 2023 00:06
@rickard-green rickard-green merged commit 1bb0131 into erlang:maint Nov 28, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants