]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/sched_ext: scx_userland: fix data races on shared counters
authorDavid Carlier <devnexen@gmail.com>
Wed, 18 Feb 2026 19:22:23 +0000 (19:22 +0000)
committerTejun Heo <tj@kernel.org>
Sat, 21 Feb 2026 03:17:31 +0000 (17:17 -1000)
commitf892f9f99464bead942a75d2b00dda6be07de97f
tree421ad80d41357a0fb00addd07ea1452cf43476cb
parent625be3456b3ced6e2dca6166962c0cf6cc2e546d
tools/sched_ext: scx_userland: fix data races on shared counters

The stats thread reads nr_vruntime_enqueues, nr_vruntime_dispatches,
nr_vruntime_failed, and nr_curr_enqueued concurrently with the main
thread writing them, with no synchronization.

Use __atomic builtins with relaxed ordering for all accesses to these
counters to eliminate the data races.

Only display accuracy is affected, not scheduling correctness.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/scx_userland.c