linux-rt-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] debugobjects: Allow to refill the pool before SYSTEM_SCHEDULING
@ 2025-11-06 12:06 Sebastian Andrzej Siewior
  2025-11-14 15:41 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-11-06 12:06 UTC (permalink / raw)
  To: linux-kernel, linux-rt-devel; +Cc: Thomas Gleixner, Oleg Nesterov

The pool of free objects is refilled on several occasions such as object
initialisation. On PREEMPT_RT refilling is limited to preemptible
sections due to sleeping locks used by the memory allocator. The system
boots with disabled interrupts so the pool can not be refilled.

If too many objects are initialized and the pool gets empty then
debugobjects disables itself.

Refiling can also happen early in the boot with disabled interrupts as
long as the scheduler is not operational. If the scheduler can not
preempt a task then a sleeping lock can not be contended.

Allow to additionally refill the pool if the scheduler is not
operational.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 lib/debugobjects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 7f50c4480a4e3..7017e5c8f32dd 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -714,7 +714,7 @@ static void debug_objects_fill_pool(void)
 	 * raw_spinlock_t are basically the same type and this lock-type
 	 * inversion works just fine.
 	 */
-	if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible()) {
+	if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible() || system_state < SYSTEM_SCHEDULING) {
 		/*
 		 * Annotate away the spinlock_t inside raw_spinlock_t warning
 		 * by temporarily raising the wait-type to WAIT_SLEEP, matching
-- 
2.51.0


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

* Re: [PATCH] debugobjects: Allow to refill the pool before SYSTEM_SCHEDULING
  2025-11-06 12:06 [PATCH] debugobjects: Allow to refill the pool before SYSTEM_SCHEDULING Sebastian Andrzej Siewior
@ 2025-11-14 15:41 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-11-14 15:41 UTC (permalink / raw)
  To: linux-kernel, linux-rt-devel; +Cc: Thomas Gleixner, Oleg Nesterov

On 2025-11-06 13:06:28 [+0100], To linux-kernel@vger.kernel.org wrote:
> The pool of free objects is refilled on several occasions such as object
> initialisation. On PREEMPT_RT refilling is limited to preemptible
> sections due to sleeping locks used by the memory allocator. The system
> boots with disabled interrupts so the pool can not be refilled.
> 
> If too many objects are initialized and the pool gets empty then
> debugobjects disables itself.
> 
> Refiling can also happen early in the boot with disabled interrupts as
> long as the scheduler is not operational. If the scheduler can not
> preempt a task then a sleeping lock can not be contended.
> 
> Allow to additionally refill the pool if the scheduler is not
> operational.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

A gentle ping.

Sebastian

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

end of thread, other threads:[~2025-11-14 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 12:06 [PATCH] debugobjects: Allow to refill the pool before SYSTEM_SCHEDULING Sebastian Andrzej Siewior
2025-11-14 15:41 ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).