Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

scx: Replace /sys/kernel/debug/sched/ext with /sys/kernel/sched_ext #122

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

htejun
Copy link
Collaborator

@htejun htejun commented Jan 18, 2024

The existing state interface in /sys/kernel/debug/sched/ext is not available if CONFIG_SCHED_DEBUG is not set. Replace it with a simpler /sys/kernel/sched_ext interface and add tools/sched_ext/scx_show_state.py to keep the same level of visibility.

This will need updates in documentation and scripts in the scx repo.

@htejun htejun requested review from arighi and Byte-Lab January 18, 2024 03:13
Copy link
Collaborator

@arighi arighi left a comment

Choose a reason for hiding this comment

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

Minor nit, everything else looks good to me. Thanks! This is very useful for distro kernels.

kernel/sched/ext.c Show resolved Hide resolved
Copy link
Collaborator

@Byte-Lab Byte-Lab left a comment

Choose a reason for hiding this comment

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

Overall looks great. Just 1 comment and a couple small nits.

kernel/sched/ext.c Outdated Show resolved Hide resolved
tools/sched_ext/scx_show_state.py Outdated Show resolved Hide resolved
kernel/sched/ext.c Show resolved Hide resolved
/sys/kernel/debug/sched/ext is the current interface file which can be used
to determine the current state of scx. This is problematic in that it's
dependent on CONFIG_SCHED_DEBUG. On kernels which don't have the option
enabled, there is no easy way to tell whether scx is currently in use.

Let's add a new kobject based interface which is created under
/sys/kernel/sched_ext. The directory contains:

- System level interface files. As it's now a non-debug interface, confine
  the exposed files to "state", "switch_all" and "nr_rejected".

- Per-scheduler directory which currently only contains "ops". The directory
  is always named "root" for now. This is in preparation of the future where
  there can be multiple schedulers loaded in a system. Loading and unloading
  of a scheduler also generates a uevent with SCXOPS attribute.

Signed-off-by: Tejun Heo <[email protected]>
…w_state.py

Now that the state is visible through /sys/kernel/sched_ext,
/sys/kernel/debug/sched/ext isn't needed to determine the current state of
scx. However, /sys/kernel/sched_ext shows only a subset of information that
was available in the debug interface and it can be useful to have access to
the rest for debugging. Remove /sys/kernel/debug/sched/ext and add the drgn
script, tools/sched_ext/scx_show_state.py, which shows the same information.

Signed-off-by: Tejun Heo <[email protected]>
@Byte-Lab Byte-Lab merged commit cdcdf18 into sched_ext Jan 18, 2024
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants