Re: [PATCH 1/2] target: drop spin_lock_assert() + irqs_disabled() combo checks

From: Bart Van Assche
Date: Mon Jun 04 2018 - 03:02:39 EST


On Mon, 2018-05-28 at 16:35 +0200, bigeasy@xxxxxxxxxxxxx wrote:
> On 2018-03-28 08:31:38 [-0700], Bart Van Assche wrote:
> > On 03/28/18 08:14, bigeasy@xxxxxxxxxxxxx wrote:
> > > On 2018-03-28 15:05:41 [+0000], Bart Van Assche wrote:
> > > > The names of the two functions touched by patch 1/2 start with a double
> > > > underscore. That by itself is already a hint that these should be called with
> > > > a lock held (I know that this is not a universal convention in the Linux
> > > > kernel). I'm fine either way - either with patch 1/2 as posted or patch 1/2
> > > > with the above comment added.
> > >
> > > Okay. In that case let me update 1/2.
> > > But 2/2 with the comment as Steven suggested is still a no no for you?
> >
> > Although I'm not enthusiast about patch 2/2, if others agree with that patch
> > I'm fine with that patch being sent upstream.
>
> I've been waiting for something to happen but nobody replied.
> Bart, you were fine with 1/2 as posted but not too happy about 2/2.
> Assuming we keep 1/2 as is and I remove just the
> "WARN_ON_ONCE(!irqs_disabled());" from 2/2 (keeping the
> assert_spin_locked()), would that improve your mood? Lockdep would still
> perform full validation, yell if __transport_check_aborted_status() was
> invoked without locking and also yell abut missing IRQ-save at locking
> time of ->t_state_lock).

Would adding WARN_ON_ONCE(!irqs_disabled()) work fine with an RT kernel?

Thanks,

Bart.