Re: [PATCH] rcutorture: Avoid problematic critical section nesting on RT

From: Scott Wood
Date: Fri Aug 20 2021 - 00:11:44 EST


On Thu, 2021-08-19 at 11:20 -0700, Paul E. McKenney wrote:
> On Thu, Aug 19, 2021 at 05:47:08PM +0200, Sebastian Andrzej Siewior wrote:
> > On 2021-08-19 17:39:29 [+0200], To Paul E. McKenney wrote:
> > > + /*
> > > + * Ideally these sequences would be detected in debug builds
> > > + * (regardless of RT), but until then don't stop testing
> > > + * them on non-RT.
> > > + */
> > > + if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
> > > + /*
> > > + * Can't release the outermost rcu lock in an irq disabled
> > > + * section without preemption also being disabled, if irqs
> > > + * had ever been enabled during this RCU critical section
> > > + * (could leak a special flag and delay reporting the qs).
> > > + */
> > > + if ((oldmask & RCUTORTURE_RDR_RCU) &&
> > > + (mask & RCUTORTURE_RDR_IRQ) &&
> > > + !(mask & preempts))
> > > + mask |= RCUTORTURE_RDR_RCU;
> >
> > This piece above, I don't understand. I had it running for a while and
> > it didn't explode. Let me try TREE01 for 30min without that piece.
>
> This might be historical. There was a time when interrupts being
> disabled across rcu_read_unlock() meant that preemption had to have
> been disabled across the entire RCU read-side critical section.
>
> I am not seeing a purpose for it now, but I could easily be missing
> something, especially given my tenuous grasp of RT.

Yeah, I think this was to deal with not having the irq work stuff in RT
at the time.

-Scott