From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754016AbcGFMAI (ORCPT ); Wed, 6 Jul 2016 08:00:08 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:42055 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbcGFMAG (ORCPT ); Wed, 6 Jul 2016 08:00:06 -0400 Date: Wed, 6 Jul 2016 13:59:54 +0200 From: Peter Zijlstra To: Paolo Bonzini Cc: Pan Xinhui , linux-s390@vger.kernel.org, dave@stgolabs.net, mpe@ellerman.id.au, boqun.feng@gmail.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, waiman.long@hpe.com, virtualization@lists.linux-foundation.org, mingo@redhat.com, paulus@samba.org, benh@kernel.crashing.org, schwidefsky@de.ibm.com, paulmck@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 0/4] implement vcpu preempted check Message-ID: <20160706115954.GK30921@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14a24854-9787-e4a1-c9a8-76eba4e97301@redhat.com> 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 Wed, Jul 06, 2016 at 12:44:58PM +0200, Paolo Bonzini wrote: > > Paolo, could you help out with an (x86) KVM interface for this? > > If it's just for spin loops, you can check if the version field in the > steal time structure has changed. That would require remembering the old value, no? That would work with a previous interface proposal, see: http://lkml.kernel.org/r/1466937715-6683-2-git-send-email-xinhui.pan@linux.vnet.ibm.com the vcpu_get_yield_count() thing would match that I think. However the current proposal: http://lkml.kernel.org/r/1467124991-13164-2-git-send-email-xinhui.pan@linux.vnet.ibm.com dropped that in favour of only vcpu_is_preempted(), which requires being able to tell if a (remote) vcpu is currently running or not, which iirc, isn't possible with the steal time sequence count.