All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC v2] sched/proxy: Defer donor commit until proxy resolution
@ 2026-07-13  6:21 Xukai Wang
  2026-07-13  6:21 ` [PATCH RFC v2] sched/proxy: Defer donor commit until after " Xukai Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Xukai Wang @ 2026-07-13  6:21 UTC (permalink / raw)
  To: Ingo Molnar, John Stultz, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, K Prateek Nayak
  Cc: linux-kernel, Xukai Wang

Hi,

This RFC tries to decouple proxy candidate selection from donor commit in the
scheduler core.

Currently pick_next_task() does not only select a task. It also commits the
selected task into the scheduling class state through put_prev_set_next_task().
With proxy execution enabled, the selected task may be a blocked donor,
and __schedule() then calls find_proxy_task() to resolve the proxy chain and
find the task that should actually run.

If find_proxy_task() returns NULL, __schedule() goes back to pick_again.
However, the picked donor has already been committed into the class current state.
This means the scheduler may first set_next() a blocked donor and then immediately
abandon that choice when proxy resolution fails.

This patch changes the model so that pick_next_task() only returns a candidate.
The actual class commit is moved to __schedule(), after proxy resolution.

I am keeping this as RFC and including John, as discussed in the v1 thread,
to check whether find_proxy_task() or the wider proxy series relies on rq->donor
being updated to the picked donor before proxy-chain resolution.

Signed-off-by: Xukai Wang <kingxukai@zohomail.com>
---
Changes in v2:
- Move the final put_prev_set_next_task()/rq_set_donor() after the
  proxy/non-proxy branches.
- Move zap_balance_callbacks() from the NULL/idle proxy-resolution
  paths into proxy_resched_idle(), next to the idle commit.
- Link to v1: https://patch.msgid.link/20260707-sched-proxy-v1-0-5928bf6dedf0@zohomail.com

---
Xukai Wang (1):
      sched/proxy: Defer donor commit until after proxy resolution

 kernel/sched/core.c | 90 +++++++++++++++++++++++++++++------------------------
 1 file changed, 49 insertions(+), 41 deletions(-)
---
base-commit: 19b7bdc3a1550ab2550427c33395bec7caeaf72d
change-id: 20260707-sched-proxy-4404b6e97ad9

Best regards,
--  
Xukai Wang <kingxukai@zohomail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-16  5:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13  6:21 [PATCH RFC v2] sched/proxy: Defer donor commit until proxy resolution Xukai Wang
2026-07-13  6:21 ` [PATCH RFC v2] sched/proxy: Defer donor commit until after " Xukai Wang
2026-08-10 10:50   ` Xukai Wang
2026-08-11 20:41   ` John Stultz
2026-08-12  5:51     ` Xukai Wang
2026-08-16  5:16   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.