lkml.org 
[lkml]   [2021]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH v1 1/3] locking/lockdep: Fix false warning of check_wait_context()
On Mon, Jul 12, 2021 at 9:04 PM Waiman Long <llong@redhat.com> wrote:
>
> On 7/12/21 4:18 AM, Xiongwei Song wrote:
> > On Mon, Jul 12, 2021 at 12:43 AM Waiman Long <llong@redhat.com> wrote:
> >> On 7/11/21 10:14 AM, Xiongwei Song wrote:
> >>> From: Xiongwei Song <sxwjean@gmail.com>
> >>>
> >>> We now always get a "Invalid wait context" warning with
> >>> CONFIG_PROVE_RAW_LOCK_NESTING=y, see the full warning below:
> >>>
> >>> [ 0.705900] =============================
> >>> [ 0.706002] [ BUG: Invalid wait context ]
> >>> [ 0.706180] 5.13.0+ #4 Not tainted
> >>> [ 0.706349] -----------------------------
> >> I believe the purpose of CONFIG_PROVE_RAW_LOCK_NESTING is experimental
> >> and it is turned off by default. Turning it on can cause problem as
> >> shown in your lockdep splat. Limiting it to just PREEMPT_RT will defeat
> >> its purpose to find potential spinlock nesting problem in non-PREEMPT_RT
> >> kernel.
> > As far as I know, a spinlock can nest another spinlock. In
> > non-PREEMPT_RT kernel
> > spin_lock and raw_spin_lock are same , so here acquiring a spin_lock in hardirq
> > context is acceptable, the warning is not needed. My knowledge on this
> > is not enough,
> > Will dig into this.
> >
> >> The point is to fix the issue found,
> > Agree. I thought there was a spinlock usage issue, but by checking
> > deactivate_slab context,
> > looks like the spinlock usage is well. Maybe I'm missing something?
>
> Yes, spinlock and raw spinlock are the same in non-RT kernel. They are
> only different in RT kernel. However, non-RT kernel is also more heavily
> tested than the RT kernel counterpart. The purpose of this config option
> is to expose spinlock nesting problem in more areas of the code. If you
> look at the config help text of PROVE_RAW_LOCK_NESTING:
>
> help
> Enable the raw_spinlock vs. spinlock nesting checks which ensure
> that the lock nesting rules for PREEMPT_RT enabled kernels are
> not violated.
>
> NOTE: There are known nesting problems. So if you enable this
> option expect lockdep splats until these problems have been fully
> addressed which is work in progress. This config switch allows to
> identify and analyze these problems. It will be removed and the
> check permanentely enabled once the main issues have been fixed.
>
> If unsure, select N.
Yes, I checked before sending patch, but didn't understand everything.
Thanks, :-).

> So lockdep splat is expected. It will take time to address all the
> issues found.
Ok.

Regards,
Xiongwei
>
> Cheers,
> Longman
>

\
 
 \ /
  Last update: 2022-09-17 16:11    [W:0.098 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site