Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

From: Frederic Weisbecker
Date: Thu Jul 19 2018 - 09:17:32 EST


On Thu, Jul 19, 2018 at 08:16:47AM +0200, David Woodhouse wrote:
>
>
> On Wed, 2018-07-18 at 20:11 -0700, Paul E. McKenney wrote:
> >
> > > That is interesting. As I replied to Paul, we are already calling
> > > rcu_user_enter/exit() on guest_enter/exit_irqsoff(). So I'm wondering why
> > > you're seeing such an optimization by repeating those calls.
> > > 
> > > Perhaps the rcu_user_* somehow aren't actually called from
> > > __context_tracking_enter()...? Some bug in context tracking?
> > > Otherwise it's a curious side effect.
> >
> > David is working with v4.15.  Is this maybe something that has changed
> > since then?
>
> To clarify: in 4.15 without CONFIG_PREEMPT and without NO_HZ_FULL I was
> seeing RCU stalls because a thread in vcpu_run() was *never* seen to go
> through a quiescent state. Hence the change to need_resched() in the
> first patch in this thread, which fixed the problem at hand and seemed
> to address the general case.
>
> It then seemed by *inspection* that the NO_HZ_FULL case was probably
> broken, because we'd failed to spot the rcu_user_* calls. But
> rcu_user_enter() does nothing in the !NO_HZ_FULL case, so wouldn't have
> helped in the testing that we were doing anyway.

Oh ok, so the optimization you saw is likely unrelated to the rcu_user* things.