From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH 1/3] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM Date: Tue, 24 Apr 2012 14:44:17 +0200 Message-ID: <4F96A021.4000704@de.ibm.com> References: <1335252285-54213-1-git-send-email-borntraeger@de.ibm.com> <1335252285-54213-2-git-send-email-borntraeger@de.ibm.com> <4F9696B8.8080108@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 e06smtp12.uk.ibm.com ([195.75.94.108]:59544 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753799Ab2DXMoV (ORCPT ); Tue, 24 Apr 2012 08:44:21 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Apr 2012 13:44:19 +0100 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3OCiFRh2605304 for ; Tue, 24 Apr 2012 13:44:15 +0100 Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3OCiEPl013041 for ; Tue, 24 Apr 2012 06:44:14 -0600 In-Reply-To: <4F9696B8.8080108@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 24/04/12 14:04, Avi Kivity wrote: [...] >> + int tid; >> + int i; >> + >> + tid = vcpu->run->s.regs.gprs[(vcpu->arch.sie_block->ipa & 0xf0) >> 4]; >> + vcpu->stat.diagnose_9c++; >> + VCPU_EVENT(vcpu, 5, "diag time slice end directed to %d", tid); >> + >> + if (tid == vcpu->vcpu_id) >> + return 0; >> + >> + kvm_for_each_vcpu(i, tcpu, kvm) { >> + if (tcpu->vcpu_id == tid) { > > Can two vcpus match the same tid? Dont think so. tid (target id) is the cpu number of the CPU holding the spinlock and vcpu_id is checked for in kvm_vcpu_init to be unique. [...] >> + vcpu_put(vcpu); >> + if (yield_to(task, 1)) { >> + vcpu_load(vcpu); > > vcpu_put()/_load()s are unneeded here, preempt notifiers will > automatically call kvm_arch_vcpu_put()/_load() if we schedule. Right. Will send an updated patch. [...] >> @@ -74,6 +74,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { >> { "instruction_sigp_restart", VCPU_STAT(instruction_sigp_restart) }, >> { "diagnose_10", VCPU_STAT(diagnose_10) }, >> { "diagnose_44", VCPU_STAT(diagnose_44) }, >> + { "diagnose_9c", VCPU_STAT(diagnose_9c) }, >> { NULL } >> }; >> > > We're switching to tracepoints instead of homebrewed statistics. It's > in feature-removal-schedule.txt already. It's okay to add them now, but > please prepare for their removal. Yes, we have started with some tracepoint code conversion. We will try to speed up a bit. Christian