From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756488AbcGGLIR (ORCPT ); Thu, 7 Jul 2016 07:08:17 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:60617 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072AbcGGLIP (ORCPT ); Thu, 7 Jul 2016 07:08:15 -0400 Date: Thu, 7 Jul 2016 13:08:01 +0200 From: Peter Zijlstra To: Wanpeng Li Cc: Paolo Bonzini , Pan Xinhui , linux-s390 , Davidlohr Bueso , mpe@ellerman.id.au, boqun.feng@gmail.com, will.deacon@arm.com, "linux-kernel@vger.kernel.org" , Waiman Long , virtualization@lists.linux-foundation.org, Ingo Molnar , Paul Mackerras , benh@kernel.crashing.org, schwidefsky@de.ibm.com, Paul McKenney , linuxppc-dev@lists.ozlabs.org, kvm Subject: Re: [PATCH v2 0/4] implement vcpu preempted check Message-ID: <20160707110801.GU30921@twins.programming.kicks-ass.net> References: <1467124991-13164-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160706065255.GH30909@twins.programming.kicks-ass.net> <14a24854-9787-e4a1-c9a8-76eba4e97301@redhat.com> <8e8edf1b-b64b-3c44-b580-b9271663844c@redhat.com> <20160707094215.GT30921@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 07, 2016 at 06:12:51PM +0800, Wanpeng Li wrote: > Btw, do this in preemption > notifier means that the vCPU is real preempted on host, however, > depends on vmexit is different semantic I think. Not sure; suppose the vcpu is about to reenter, eg, we're in vcpu_enter_guest() but before the preempt_disable() and the thread gets preempted. Are we then not preempted? The vcpu might still very much be in running state but had to service an vmexit due to an MSR or IO port or whatnot. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v2 0/4] implement vcpu preempted check Date: Thu, 7 Jul 2016 13:08:01 +0200 Message-ID: <20160707110801.GU30921@twins.programming.kicks-ass.net> References: <1467124991-13164-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160706065255.GH30909@twins.programming.kicks-ass.net> <14a24854-9787-e4a1-c9a8-76eba4e97301@redhat.com> <8e8edf1b-b64b-3c44-b580-b9271663844c@redhat.com> <20160707094215.GT30921@twins.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-s390 , Davidlohr Bueso , benh@kernel.crashing.org, kvm , mpe@ellerman.id.au, boqun.feng@gmail.com, will.deacon@arm.com, "linux-kernel@vger.kernel.org" , Waiman Long , virtualization@lists.linux-foundation.org, Ingo Molnar , Paul Mackerras , Pan Xinhui , schwidefsky@de.ibm.com, Paolo Bonzini , Paul McKenney , linuxppc-dev@lists.ozlabs.org To: Wanpeng Li Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: kvm.vger.kernel.org On Thu, Jul 07, 2016 at 06:12:51PM +0800, Wanpeng Li wrote: > Btw, do this in preemption > notifier means that the vCPU is real preempted on host, however, > depends on vmexit is different semantic I think. Not sure; suppose the vcpu is about to reenter, eg, we're in vcpu_enter_guest() but before the preempt_disable() and the thread gets preempted. Are we then not preempted? The vcpu might still very much be in running state but had to service an vmexit due to an MSR or IO port or whatnot.