diff options
| author | Andrea Righi <arighi@nvidia.com> | 2026-09-22 18:51:49 +0200 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-09-28 09:48:04 -1000 |
| commit | 13ae184e4b8279dcc7b84bf58e987a60d9aad69a (patch) | |
| tree | 2c8de0dc108d67ab35080c70bc31aeeb90dbe00f /tools/perf/scripts/python/stackcollapse.py | |
| parent | 4eeabe0a3ef7069ba00d450b8b21fd5e0fe76e13 (diff) | |
sched_ext: Handle proxy-exec races in remote DSQ transfers
Without proxy execution, the DSQ lock and holding_cpu handshake ensure
that a task cannot be dequeued or start running during an rq-lock
handoff without clearing holding_cpu.
Proxy execution is an exception: a task can start physically executing
as a lock owner while its scheduling context remains on a DSQ; its
on-CPU or migration-disabled state can therefore change without
clearing holding_cpu.
Recheck these states after acquiring the source rq lock. If the transfer
can no longer proceed, park the task on the source rq's reject DSQ and
reenqueue it through its owning scheduler. This preserves the BPF
scheduler's placement policy and keeps descendant tasks within their
sub-scheduler's cap grants.
Queue a deferred drain for every rejection. If a drain finds a
proxy-rejected task still running or donating, leave it parked and
record a retry request on the rq. scx_proxy_reenqueue_retry() consumes
the request and schedules another drain when proxy state changes.
Without this change and proxy execution enabled, stress-ng --pipeherd
can trigger this race and migrate an active execution context, leading
to sleeping-while-atomic warnings and subsequent lockdep corruption.
This is a preparatory change to support proxy execution with sched_ext.
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
