From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH 1/3v2] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM Date: Tue, 24 Apr 2012 17:47:34 +0200 Message-ID: <4F96CB16.8060700@de.ibm.com> References: <4F96A021.4000704@de.ibm.com> <1335272114-64505-1-git-send-email-borntraeger@de.ibm.com> <4F96A55E.1050703@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tossati , Carsten Otte , Alexander Graf , Jens Freimann , Cornelia Huck , Heiko Carstens , Martin Schwidefsky , Heinz Graalfs , KVM , Konstantin Weitz To: Avi Kivity Return-path: Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:48834 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755671Ab2DXPrs (ORCPT ); Tue, 24 Apr 2012 11:47:48 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Apr 2012 16:47:46 +0100 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3OFlVZN1941548 for ; Tue, 24 Apr 2012 16:47:31 +0100 Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3OFlUff013903 for ; Tue, 24 Apr 2012 09:47:30 -0600 In-Reply-To: <4F96A55E.1050703@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: > I think the code will me more readable, and less obvious that is was > copied from kvm_vcpu_on_spin(), if you put all the processing outside > the loop, except for matching the vpu itself. > > So the code reads > > find a vcpu > obtain the task > do the yield > > instead of looking like you're doing the processing for every vcpu. The > loop is just a slow lookup which might some day be replaced by a table > lookup. Ok. We might also have a kvm_vcpu_on_spin_directed in common code, Would you prefer that? Christian