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

Add support for reset-on-fork scheduling flag #2360

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

rst0git
Copy link
Member

@rst0git rst0git commented Mar 4, 2024

This pull request extends CRIU with checkpoint/restore support for the reset-on-fork scheduling flag (SCHED_RESET_ON_FORK). When this flag is set, the following rules apply for subsequently created children:

  • If the calling thread has a scheduling policy of SCHED_FIFO or SCHED_RR, the policy is reset to SCHED_OTHER in child processes.

  • If the calling process has a negative nice value, the nice value is reset to zero in child processes.

(See man 7 sched)

Fixes: #2359

criu/cr-dump.c Show resolved Hide resolved
criu/cr-restore.c Outdated Show resolved Hide resolved
This patch extends CRIU with support for SCHED_RESET_ON_FORK.
When the SCHED_RESET_ON_FORK flag is set, the following rules
apply for subsequently created children:

- If the calling thread has a scheduling policy of SCHED_FIFO or
SCHED_RR, the policy is reset to SCHED_OTHER in child processes.

- If the calling process has a negative nice value, the nice value
is reset to zero in child processes.

(See 'man 7 sched')

Fixes: checkpoint-restore#2359

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This patch extends the sched_policy00 test case to verify that
the SCHED_RESET_ON_FORK flag is restored correctly.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
@muvaf
Copy link

muvaf commented Mar 12, 2024

I built this PR and can confirm the error I was getting is resolved.

@avagin avagin merged commit 2355a2a into checkpoint-restore:criu-dev Mar 25, 2024
36 of 39 checks passed
@rst0git rst0git deleted the sched-reset-on-fork branch March 26, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot restore unix socket of X11: No such file or directory
3 participants