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

scheduler: use sched_setattr #1166

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

giuseppe
Copy link
Member

replace sched_setscheduler() with sched_setattr().

The sched_setattr() function allows setting multiple attributes at once, including the scheduling policy, priority, runtime, deadline, period, and other scheduling options. This feature provides more flexibility and control over the scheduling of processes within containers and can improve resource utilization and performance in specific use cases.

@rhatdan
Copy link
Member

rhatdan commented Mar 15, 2023

LGTM

replace sched_setscheduler() with sched_setattr().

The sched_setattr() function allows setting multiple attributes at
once, including the scheduling policy, priority, runtime, deadline,
period, and other scheduling options.  This feature provides more
flexibility and control over the scheduling of processes within
containers and can improve resource utilization and performance in
specific use cases.

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the scheduler-set-attr branch from 3b88716 to 5d54a85 Compare March 15, 2023 22:26
Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe
Copy link
Member Author

I think this makes sense as part of the runtime-specs: opencontainers/runtime-spec#1188

hswong3i added a commit to alvistack/containers-crun that referenced this pull request Mar 23, 2023
The newly introduced `src/libcrun/scheduler.c` by
containers#1166 missing `#include
<linux/sched.h>` for CentOS 7, which result with missing
`SCHED_DEADLINE`.

Moreover, for CentOS 7 build we also need to enable `-std=c99`, or
upgrade build tools to gcc 11 with `. /opt/rh/devtoolset-11/enable`
before build.

See https://stackoverflow.com/a/50085457

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/containers-crun that referenced this pull request Mar 23, 2023
The newly introduced `src/libcrun/scheduler.c` by
containers#1166 missing `#include
<linux/sched.h>` for CentOS 7, which result with missing
`SCHED_DEADLINE`.

Moreover, for CentOS 7 build we also need to enable `-std=c99`, or
upgrade build tools to gcc 11 with `. /opt/rh/devtoolset-11/enable`
before build.

See https://stackoverflow.com/a/50085457
See https://github.com/alvistack/containers-crun/blob/alvistack/1.8.2/crun.spec

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
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.

3 participants