From patchwork Thu Apr 28 09:52:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 739011 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3S9qin7013901 for ; Thu, 28 Apr 2011 09:52:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758200Ab1D1JwM (ORCPT ); Thu, 28 Apr 2011 05:52:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17410 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754597Ab1D1JwK (ORCPT ); Thu, 28 Apr 2011 05:52:10 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3S9q4Zq026405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Apr 2011 05:52:05 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3S9q4mS004807; Thu, 28 Apr 2011 05:52:04 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 87D3E18D3EB; Thu, 28 Apr 2011 12:52:03 +0300 (IDT) From: Gleb Natapov To: linux-kernel@vger.kernel.org Cc: paulmck@linux.vnet.ibm.com, avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org Subject: [PATCH 2/2] KVM: make guest mode entry to be rcu quiescent state Date: Thu, 28 Apr 2011 12:52:03 +0300 Message-Id: <1303984323-3203-3-git-send-email-gleb@redhat.com> In-Reply-To: <1303984323-3203-1-git-send-email-gleb@redhat.com> References: <1303984323-3203-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Apr 2011 09:52:52 +0000 (UTC) KVM does not hold any references to rcu protected data when it switches CPU into a guest mode. In fact switching to a guest mode is very similar to exiting to userspase from rcu point of view. In addition CPU may stay in a guest mode for quite a long time (up to one time slice). Lets treat guest mode as quiescent state, just like we do with user-mode execution. Signed-off-by: Gleb Natapov --- include/linux/kvm_host.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 0bc3d37..a347bce 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -593,6 +593,7 @@ static inline void kvm_guest_enter(void) { account_system_vtime(current); current->flags |= PF_VCPU; + rcu_note_context_switch(smp_processor_id()); } static inline void kvm_guest_exit(void)