mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/proxy: Correct the SCHED_PROXY_EXEC dependency comment
@ 2026-09-30  2:58 Quchaosheng
  2026-09-30  6:25 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: Quchaosheng @ 2026-09-30  2:58 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	John Stultz, Valentin Schneider, linux-kernel, linux-rt-devel,
	Quchaosheng

The comment on the !PREEMPT_RT dependency reads

	# Avoid some build failures w/ PREEMPT_RT until it can be fixed

That describes what happens once the dependency is removed, not the
reason it is there, and "fixed" is never defined, so nothing says when
the dependency can be dropped.

The build failures are real, but they are not the whole reason. Under
PREEMPT_RT a mutex is an rt_mutex, and its PI path takes pi_lock under
wait_lock and rq->lock under pi_lock. find_proxy_task() takes
mutex->wait_lock under rq->lock, so

	wait_lock -> pi_lock -> rq->lock -> wait_lock

closes into a cycle. It stays dormant only because nothing sets
blocked_on when PREEMPT_RT is set, and it is gone once a mutex is no
longer an rt_mutex, which is also the condition that lets the dependency
be dropped.

No functional change.

Link: https://lore.kernel.org/all/20260921102712.3245860-1-quchaosheng000406@163.com/
Signed-off-by: Quchaosheng <quchaosheng000406@163.com>
---
 init/Kconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index 8583d9f..b45d8b2 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -936,7 +936,11 @@ config UCLAMP_BUCKETS_COUNT
 
 config SCHED_PROXY_EXEC
 	bool "Proxy Execution"
-	# Avoid some build failures w/ PREEMPT_RT until it can be fixed
+	# Fixing the build failures is not enough: under PREEMPT_RT a mutex
+	# is an rt_mutex whose PI path takes pi_lock under wait_lock and
+	# rq->lock under pi_lock, while find_proxy_task() takes
+	# mutex->wait_lock under rq->lock. The two orders close a cycle that
+	# only goes away once a mutex is no longer an rt_mutex.
 	depends on !PREEMPT_RT
 	# Need to investigate how to inform sched_ext of split contexts
 	depends on !SCHED_CLASS_EXT
-- 
2.43.0


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

* Re: [PATCH] sched/proxy: Correct the SCHED_PROXY_EXEC dependency comment
  2026-09-30  2:58 [PATCH] sched/proxy: Correct the SCHED_PROXY_EXEC dependency comment Quchaosheng
@ 2026-09-30  6:25 ` Sebastian Andrzej Siewior
  2026-09-30  6:32   ` Chaosheng Qu
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-09-30  6:25 UTC (permalink / raw)
  To: Quchaosheng
  Cc: Peter Zijlstra, Ingo Molnar, Clark Williams, Steven Rostedt,
	John Stultz, Valentin Schneider, linux-kernel, linux-rt-devel

On 2026-09-30 10:58:24 [+0800], Quchaosheng wrote:
> The comment on the !PREEMPT_RT dependency reads
> 
> 	# Avoid some build failures w/ PREEMPT_RT until it can be fixed
> 
> That describes what happens once the dependency is removed, not the
> reason it is there, and "fixed" is never defined, so nothing says when
> the dependency can be dropped.

No, please leave it as-it. This information is the for the end-user not
necessarily a developer. What you add is an information for someone who
can read code. This information adds no value IMHO.

This is enough as it is. Someone familiar with the scheduler can
certainly remove the dependency while adding the needed code and
replacing the current PI bits.

Sebastian

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

* Re: [PATCH] sched/proxy: Correct the SCHED_PROXY_EXEC dependency comment
  2026-09-30  6:25 ` Sebastian Andrzej Siewior
@ 2026-09-30  6:32   ` Chaosheng Qu
  0 siblings, 0 replies; 3+ messages in thread
From: Chaosheng Qu @ 2026-09-30  6:32 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Peter Zijlstra, Ingo Molnar, linux-kernel, linux-rt-devel

Understood, and you are right that the existing line reads fine for the
audience it is written for. I was reading it as a developer note about when
the dependency can be dropped, which is not what it is there for.

Dropping it, the patch is withdrawn. Sorry for the noise.


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

end of thread, other threads:[~2026-09-30  6:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30  2:58 [PATCH] sched/proxy: Correct the SCHED_PROXY_EXEC dependency comment Quchaosheng
2026-09-30  6:25 ` Sebastian Andrzej Siewior
2026-09-30  6:32   ` Chaosheng Qu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®