Re: usage of DEFINE_WAIT_OVERRIDE_MAP(LD_WAIT_SLEEP)
From: Oleg Nesterov
Date: Fri Oct 24 2025 - 06:31:53 EST
On 10/23, Sebastian Andrzej Siewior wrote:
>
> On 2025-10-23 17:53:40 [+0200], Oleg Nesterov wrote:
> > Sebastian,
> Hi Oleg,
>
> > sorry. I guess this is my fault, but I can't understand your reply...
> > Could you spell please?
>
> So you refer to this:
> | /* PREEMPT_RT kernels map spinlock to rt_mutex */
> | #include <linux/rtmutex.h>
> |
> | typedef struct spinlock {
> | struct rt_mutex_base lock;
> | #ifdef CONFIG_DEBUG_LOCK_ALLOC
> | struct lockdep_map dep_map;
> | #endif
> | } spinlock_t;
>
> spinlock_t on PREEMPT_RT does not use (struct) rt_mutex as the comment
> claims. It uses just the basic building block which is "struct
> rt_mutex_base". This requires linux/rtmutex.h.
>
> spinlock_t on PREEMPT_RT uses LD_WAIT_CONFIG via SPIN_DEP_MAP_INIT as
> !PREEMPT_RT. Nothing changes here.
Ah, indeed, I was confused and didn't even bother to read the definitions
below, spinlock->dep_map is initialized by the same SPIN_DEP_MAP_INIT()...
Sebastian, thanks for correcting me! Sorry, I could not carefully read
your emails yesterday.
Oleg.