← Back to archive

Daily update · Aug 3–4, 2026

PSI, sched_ext deadlock fixes lead the day; KHO, fscrypt idmap, fsverity cleanup follow

Pressure stall info threading gets reworked to drop cgroup_mutex before forking psimon, while sched_ext gains several cgroup locking and task-state fixes.

In brief

Today's mainline work centers on sched_ext and PSI interactions, fixing real deadlocks and use-after-frees around cgroup locking. KHO hits a page-fault crash during boot that is fixed by aligning scratch allocation, and fscrypt's idmapped mount owner check is corrected.

Bug fixes

PSI: fork psimon kthread outside cgroup_mutex to break deadlock

An earlier PSI fix made pressure_write() hold cgroup_mutex across psi_trigger_create(), which forks the psimon kthread. Because kthread creation depends on the whole fork path, this introduced broad locking dependencies. sched_ext's enable path blocks forks then grabs cgroup_mutex, so a pressure write racing a scheduler enable deadlocked and piled up every other fork.

Why it matters: Fixes a deadlock between PSI pressure writes and sched_ext enable; relevant for systems using sched_ext with PSI triggers.

fadeedd7cfc5

PSI: shut down rtpoll_timer in psi_cgroup_free to avoid use-after-free

psi_schedule_rtpoll_work() is called locklessly from the scheduler hot path and can race psi_trigger_destroy(). A re-armed rtpoll_timer could remain pending after the group is freed, so poll_timer_fn() ran on freed memory. The fix explicitly shuts down rtpoll_timer in psi_cgroup_free().

Why it matters: Prevents a use-after-free in PSI rtpoll teardown during cgroup destruction.

5457025fa8ca

sched_ext: fix cgroup_lock ordering deadlock

scx_cgroup_lock() write-locked scx_cgroup_ops_rwsem then took cgroup_lock(), which could deadlock through kernfs when cgroup rmdir and cpu.weight writes overlapped. Taking cgroup_lock() first removes the circular dependency.

Why it matters: Fixes a deadlock across sched_ext enable/disable, cgroup rmdir, and cpu.weight writes.

5f8b69642d18

sched_ext: skip sub-disable teardown for never-linked sub-schedulers

A sub-scheduler enable can fail before being linked into the hierarchy, yet cleanup still ran the full scx_sub_disable(). That was racy against root disable and could cause a use-after-free where tasks exited to no scheduler. The fix skips teardown when the sub was never linked.

Why it matters: Avoids a use-after-free and WARN during sched_ext sub-scheduler enable failure racing root disable.

8c13364db9c9

sched_ext: gate task enable on class in sub-sched loops

Root enable and fork only enable tasks already on the ext class, but the sub enable-commit and sub-disable re-home loops enabled unconditionally. A fair-class READY task could become ENABLED while not on sched_ext, later tripping state validation and calling ops.enable() twice.

Why it matters: Fixes invalid task state and double ops.enable() under SCX_OPS_SWITCH_PARTIAL with sub-schedulers.

5cdc92859809

sched_ext: reject disallow from init_task outside enable path

The p->scx.disallow revert assumed the root enable path, but the sub-scheduler disable path also reached it when re-initializing returned tasks on a root parent. Nothing reads the policy there, so the task kept running on the ext class with a silently rewritten policy. The fix kills the sched instead, matching fork and non-root branches.

Why it matters: Corrects sched_ext behavior when disabling sub-schedulers under a root parent; avoids silent policy rewriting.

477869bfafea

sched_ext: mark waker CPU busy in WAKE_SYNC case

SCX's built-in idle tracking can be out of sync, especially right after enabling. scx_select_cpu_dfl() skipped marking the selected CPU busy when it was the waker CPU in WAKE_SYNC, so an idle-marked waker stayed idle and could be selected again. The fix explicitly marks the waker busy.

Why it matters: Fixes an allowed_cpus selftest failure and improves idle CPU tracking accuracy.

9591fcc95ddd

selftests/sched_ext: handle sleeping task affinity changes in numa test

When a sleeping task's affinity changed, task_cpu(p) could be outside p->cpus_ptr until wakeup selected a new runqueue, so numa_select_cpu() could pick a CPU outside the cpumask and fail with -EBUSY, causing the numa scheduler to exit with 'invalid CPU -16'. The fix accounts for the transient mismatch.

Why it matters: Stabilizes the sched_ext numa selftest under affinity changes.

d4a00d61a5c2

KHO: align kho_scratch to MAX_ORDER_NR_PAGES pages

Booting with kexec handover (KHO) crashed in __free_one_page with a page fault because kho_scratch was not aligned to MAX_ORDER_NR_PAGES. The fix aligns the scratch allocation accordingly.

Why it matters: Fixes a boot-time page fault crash when using KHO.

797fe91e50d6

fscrypt: use mount idmap for owner check in set_policy

fscrypt_ioctl_set_policy() used &nop_mnt_idmap instead of the actual mount's idmap, so on idmapped mounts it compared the caller's fsuid against the unmapped on-disk owner. The real owner could be denied -EACCES and an unrelated caller wrongly allowed. The fix uses file_mnt_idmap(filp).

Why it matters: Corrects encryption policy permission checks on idmapped ext4/f2fs mounts.

cf6c993c0fec

fsverity: remove unnecessary enabled check in setattr_prepare

The check for fs-verity being enabled in the kernel was unnecessary because filesystems can have fsverity files without fs-verity enabled, and the check did not actually prevent truncate in that case. The fix removes the check.

Why it matters: Cleanup of incorrect fsverity truncation guard; marked for stable.

d2f96bcb89d3

Source commits12 entries +
5457025fa8ca

sched/psi: Shut down rtpoll_timer in psi_cgroup_free()

Tejun Heo · Jul 12, 2026 · 1 files

fadeedd7cfc5

sched/psi: Create the psimon kthread outside of cgroup_mutex

Tejun Heo · Jul 12, 2026 · 3 files

477869bfafea

sched_ext: Reject setting disallow from init_task outside the enable path

Tejun Heo · Jul 16, 2026 · 2 files

5f8b69642d18

sched_ext: Take cgroup_lock() first in scx_cgroup_lock()

Tejun Heo · Jul 16, 2026 · 1 files

8c13364db9c9

sched_ext: Skip sub-disable teardown for never-linked sub-schedulers

Tejun Heo · Jul 16, 2026 · 1 files

5cdc92859809

sched_ext: Don't enable non-ext tasks in the sub-sched task loops

Tejun Heo · Jul 16, 2026 · 1 files

797fe91e50d6

kho: align kho_scratch to MAX_ORDER_NR_PAGES pages

Michal Clapinski · Jul 17, 2026 · 1 files

9591fcc95ddd

sched_ext: Mark waker CPU busy when selected in WAKE_SYNC case

Kuba Piecuch · Jul 22, 2026 · 1 files

d4a00d61a5c2

selftests/sched_ext: Handle sleeping task affinity changes in numa test

Kuba Piecuch · Jul 23, 2026 · 1 files

cf6c993c0fec

fscrypt: use the mount idmap for the owner check in fscrypt_ioctl_set_policy()

Zhan Xusheng · Jul 25, 2026 · 1 files

d2f96bcb89d3

fs,fsverity: remove check for fsverity being enabled in setattr_prepare()

Andrey Albershteyn · Jul 27, 2026 · 1 files

2fd9b4cfcefe

Docs/admin-guide/cgroup-v2: document io.latency rotational vs non-rotational behavior

Tao Cui · Jul 28, 2026 · 1 files