[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251020145310.GA9608@redhat.com>
Date: Mon, 20 Oct 2025 16:53:10 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: "Luis Claudio R. Goncalves" <lgoncalv@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>, Tejun Heo <tj@...nel.org>,
David Vernet <dvernet@...a.com>, Barret Rhoden <brho@...gle.com>,
Josh Don <joshdon@...gle.com>, Crystal Wood <crwood@...hat.com>,
linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
Juri Lelli <juri.lelli@...hat.com>, Ben Segall <bsegall@...gle.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...hat.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Wander Lairson Costa <wander@...hat.com>
Subject: usage of DEFINE_WAIT_OVERRIDE_MAP(LD_WAIT_SLEEP)
Hi Sebastian,
(change subject to not add more confusion)
On 08/11, Sebastian Andrzej Siewior wrote:
>
> On 2025-08-01 12:24:29 [+0200], Oleg Nesterov wrote:
> > s/LD_WAIT_SLEEP/LD_WAIT_CONFIG/ needs another discussion even if I am right,
> > sorry for the confusion.
>
> You are correct Oleg. I've been just verifying it and yes: LD_WAIT_SLEEP
> suppresses also mutex while the intention is to only suppress
> spinlock_t.
> We have four users in tree, based on quick check all four should use
> CONFIG, three of them do use SLEEP.
No ;)
I was going to send the patch which does s/SLEEP/CONFIG/, but this
would be wrong. printk_legacy_map can use LD_WAIT_CONFIG, but lets
look at debug_objects_fill_pool()
if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible()) {
/*
* Annotate away the spinlock_t inside raw_spinlock_t warning
* by temporarily raising the wait-type to WAIT_SLEEP, matching
* the preemptible() condition above.
*/
static DEFINE_WAIT_OVERRIDE_MAP(fill_pool_map, LD_WAIT_SLEEP);
lock_map_acquire_try(&fill_pool_map);
fill_pool();
lock_map_release(&fill_pool_map);
}
If CONFIG_PREEMPT_RT=y and preemptible() is true, LD_WAIT_CONFIG won't work.
lockdep will complain if fill_pool() takes a spinlock_t, spinlock is
LD_WAIT_SLEEP on RT.
I guess debug_objects_fill_pool() actually needs something like
if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible()) {
static DEFINE_WAIT_OVERRIDE_MAP(fill_pool_map, LD_WAIT_CONFIG);
if (!IS_ENABLED(CONFIG_PREEMPT_RT))
lock_map_acquire_try(&fill_pool_map);
fill_pool();
if (!IS_ENABLED(CONFIG_PREEMPT_RT))
lock_map_release(&fill_pool_map);
}
but this is obviously too ugly. I am wondering if we can cleanup this logic
somehow...
Oleg.
Powered by blists - more mailing lists