From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: [PATCH 4/4] kvm,rcu: use RCU extended quiescent state when running KVM guest Date: Thu, 05 Feb 2015 14:02:35 -0500 Message-ID: <54D3BE4B.9090301@redhat.com> References: <1423154134-17391-1-git-send-email-riel@redhat.com> <1423154134-17391-5-git-send-email-riel@redhat.com> <54D39DF0.3020109@de.ibm.com> <54D39FD5.2040402@redhat.com> <20150205175014.GG5370@linux.vnet.ibm.com> <54D3B1CF.1000301@redhat.com> <20150205185627.GK5370@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Christian Borntraeger , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mtosatti@redhat.com, mingo@kernel.org, ak@linux.intel.com, oleg@redhat.com, masami.hiramatsu.pt@hitachi.com, fweisbec@gmail.com, lcapitulino@redhat.com, pbonzini@redhat.com To: paulmck@linux.vnet.ibm.com Return-path: In-Reply-To: <20150205185627.GK5370@linux.vnet.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 02/05/2015 01:56 PM, Paul E. McKenney wrote: > The real danger is doing neither. > > On tick_nohz_full_cpu() CPUs, the exit-to-userspace code should invoke > rcu_user_enter(), which sets some per-CPU state telling RCU to ignore > that CPU, since it cannot possibly do host RCU read-side critical sections > while running a guest. > > In contrast, a non-tick_nohz_full_cpu() CPU doesn't let RCU > know that it is executing in a guest or in userspace. So the > rcu_virt_note_context_switch() does the notification in that case. Looking at context_tracking.h, I see the function context_tracking_cpu_is_enabled(). That looks like it should do the right thing in this case.