All Products
Search
Document Center

Alibaba Cloud Linux:The SCHED_IDLE feature of cgroups

Last Updated:Apr 01, 2026

When running mixed workloads—latency-sensitive services alongside background batch jobs—you need a way to deprioritize the batch cgroup so it consumes CPU only when no higher-priority peers need it. Alibaba Cloud Linux 3 provides the cpu.idle interface, the cgroup-level analog of the per-task SCHED_IDLE scheduling policy. Set cpu.idle to 1 on a cgroup to mark it as idle-priority: the cgroup competes for CPU only when no non-idle peers are runnable. This feature requires kernel version 5.10.134-16.al8 or later.

Interface file location

The cpu.idle interface file location depends on the cgroup version:

cgroup versionPath
cgroup v1/sys/fs/cgroup/cpu/$cg
cgroup v2/sys/fs/cgroup/$cg

$cg is a placeholder for the cgroup name.

Enable or disable SCHED_IDLE for a cgroup

InterfaceValueEffect
cpu.idle0Disables the SCHED_IDLE scheduling policy for the cgroup.
cpu.idle1Enables the SCHED_IDLE scheduling policy for the cgroup. The cgroup receives the minimum time slice weight and is no longer guaranteed a minimum runtime.

Limitations

Enabling SCHED_IDLE (setting cpu.idle to 1) has the following side effects due to incompatibilities between cgroup versions and the SCHED_IDLE policy:

cgroup versionLimitation
cgroup v1The cpu.shares interface cannot be overridden.
cgroup v2The cpu.weight and cpu.weight.nice interfaces cannot be overridden.