From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754064AbbBET1L (ORCPT ); Thu, 5 Feb 2015 14:27:11 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:45364 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752711AbbBET1J (ORCPT ); Thu, 5 Feb 2015 14:27:09 -0500 Date: Thu, 5 Feb 2015 11:27:04 -0800 From: "Paul E. McKenney" To: Rik van Riel 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 Subject: Re: [PATCH 4/4] kvm,rcu: use RCU extended quiescent state when running KVM guest Message-ID: <20150205192704.GM5370@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.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> <54D3BE4B.9090301@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D3BE4B.9090301@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15020519-0009-0000-0000-0000088A3D71 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 05, 2015 at 02:02:35PM -0500, Rik van Riel wrote: > 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. Right you are -- that same check is used to guard the context_tracking_user_enter() function's call to rcu_user_enter(). Not sure why it open-codes the check rather than invoking context_tracking_cpu_is_enabled(). Hmmm.... One reason is that the context_tracking_cpu_is_enabled() function isn't available in that context, according to my compiler. ;-) Thanx, Paul