process-util: Add support SCHED_EXT scheduling policy

Allow CPUSchedulingPolicy to be set to "ext". SCHED_EXT is a new
scheduling policy in Linux v6.12 that allows processes to be scheduled
using custom BPF schedulers instead of the default in-kernel ones.

Selectively setting the SCHED_EXT policy is useful for systems running
in "partial mode" where not all processes are run using a custom
scheduler.

Fallback to SCHED_OTHER and print an error message for systems where
SCHED_EXT isn't available.
This commit is contained in:
Matt Fleming
2025-12-20 18:31:55 +01:00
committed by Mike Yuan
parent 84dcbc3fd2
commit 4dcbfbb1ad
9 changed files with 69 additions and 10 deletions
+6 -2
View File
@@ -5473,8 +5473,12 @@ int exec_invoke(
r = sched_setattr(/* pid= */ 0, &attr, /* flags= */ 0);
if (r < 0) {
*exit_status = EXIT_SETSCHEDULER;
return log_error_errno(errno, "Failed to set up CPU scheduling: %m");
if (errno != EINVAL || sched_policy_supported(attr.sched_policy)) {
*exit_status = EXIT_SETSCHEDULER;
return log_error_errno(errno, "Failed to set up CPU scheduling: %m");
}
log_warning_errno(errno, "CPU scheduling policy %u is not supported, ignoring: %m", attr.sched_policy);
}
}