Re: [PATCH] lockdep: Fix wait context check on softirq for PREEMPT_RT

From: Sebastian Andrzej Siewior
Date: Fri Dec 20 2024 - 02:16:08 EST


On 2024-12-19 14:27:11 [-0800], Boqun Feng wrote:
> diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h
> index fc53e0ad56d9..7191a753e983 100644
> --- a/include/linux/bottom_half.h
> +++ b/include/linux/bottom_half.h
> @@ -4,6 +4,7 @@
>
> #include <linux/instruction_pointer.h>
> #include <linux/preempt.h>
> +#include <linux/lockdep.h>
>
> #if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS)
> extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
> @@ -15,9 +16,12 @@ static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int
> }
> #endif
>
> +extern struct lockdep_map bh_lock_map;
> +
> static inline void local_bh_disable(void)
> {
> __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
> + lock_map_acquire_read(&bh_lock_map);
> }

Could you put this before __local_bh_disable_ip(), please?

Sebastian