From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederic Weisbecker Subject: Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested Date: Thu, 19 Jul 2018 15:14:24 +0200 Message-ID: <20180719131422.GC5595@lerouge> References: <20180716154015.GA21419@linux.vnet.ibm.com> <1531815548.19223.23.camel@infradead.org> <20180717125653.GH12945@linux.vnet.ibm.com> <20180718153628.GA24359@linux.vnet.ibm.com> <1531929711.3414.29.camel@infradead.org> <20180718163712.GB12945@linux.vnet.ibm.com> <1531942865.3414.35.camel@infradead.org> <20180718201700.GN12945@linux.vnet.ibm.com> <86d12d1a-46dd-d82a-96c2-e842ac5a2a6c@de.ibm.com> <1531984833.12620.16.camel@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Christian Borntraeger , paulmck@linux.vnet.ibm.com, Peter Zijlstra , mhillenb@amazon.de, linux-kernel , kvm To: David Woodhouse Return-path: Content-Disposition: inline In-Reply-To: <1531984833.12620.16.camel@infradead.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, Jul 19, 2018 at 09:20:33AM +0200, David Woodhouse wrote: > On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: > > > > > My thought would be something like this: > > >  > > >       if (context_tracking_cpu_is_enabled()) > > >               rcu_kvm_enter(); > > >       else > > >               rcu_virt_note_context_switch(smp_processor_id()); > > > > In the past we needed that (when we introduced that). At least with every > > host interrupt we called this making an rcu event at least every HZ. > > Will the changes in need_resched make this part unnecessary? > > Yes, the change in need_resched() should make this part unnecessary. > Unless your architecture's version of the vcpu_run() loop just loops > forever even when TIF_NEED_RESCHED is set? :) > > I'm not sure about the context tracking condition in the code snippet > cited above, though. I think that's what caused my problem in the first > place — I have CONTEXT_TRACKING_FORCE && !NO_HZ_FULL. So in 4.15, that > means rcu_user_enter() did nothing and rcu_virt_note_context_switch() > wasn't called. Hence the observed stalls. > > Should rcu_user_enter() itself be conditional on CONTEXT_TRACKING not > NO_HZ_FULL?  Ah, CONTEXT_TRACKING_FORCE is only for testing purpose, you should not select it, it's going to introduce overhead. Actually I should remove that. Although since we have removed CONFIG_NOHZ_FULL_ALL it's the last way we have to test NOHZ_FULL from config alone.