mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
sched_ext: Use irq_work for deferred actions with proxy execution
maybe_queue_balance_callback() clears SCX_RQ_BAL_CB_PENDING when it
queues the deferred callback. Proxy resolution can then zap the callback
without running it, leaving the deferred actions unscheduled until a
later wakeup or deferred request.
Use the existing irq_work fallback for dispatch-time deferred requests
when proxy execution is enabled. This keeps the work scheduled even if
proxy resolution retries the pick or falls back to idle, without relying
on another SCX dispatch to restore a discarded callback.
Fixes: a8ad873113 ("sched_ext: defer queue_balance_callback() until after ops.dispatch")
Reported-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/08cac02c604dd73ef96fc92eb29d692b@kernel.org
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
e2859566ff
commit
9b5ce4345b
|
|
@ -1129,9 +1129,10 @@ static void schedule_deferred_locked(struct rq *rq)
|
|||
return;
|
||||
|
||||
/*
|
||||
* If in dispatch, the balance callbacks will be called before rq lock
|
||||
* is released. Schedule one.
|
||||
*
|
||||
* If in dispatch without proxy execution, the balance callbacks will
|
||||
* be called before rq lock is released. Schedule one. With proxy
|
||||
* execution, proxy resolution can zap the callbacks without another
|
||||
* SCX dispatch to requeue them, so use irq_work instead.
|
||||
*
|
||||
* We can't directly insert the callback into the
|
||||
* rq's list: The call can drop its lock and make the pending balance
|
||||
|
|
@ -1139,7 +1140,7 @@ static void schedule_deferred_locked(struct rq *rq)
|
|||
*
|
||||
* Just let dispatch_one() know that it must do it itself.
|
||||
*/
|
||||
if (rq->scx.flags & SCX_RQ_IN_DISPATCH) {
|
||||
if ((rq->scx.flags & SCX_RQ_IN_DISPATCH) && !sched_proxy_exec()) {
|
||||
rq->scx.flags |= SCX_RQ_BAL_CB_PENDING;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user