From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Date: Tue, 29 Aug 2017 11:23:42 +0000 Subject: Re: [PATCH RFC v3 1/9] KVM: s390: optimize detection of started vcpus Message-Id: <20170829132342.1ef25500.cohuck@redhat.com> List-Id: References: <20170821203530.9266-1-rkrcmar@redhat.com> <20170821203530.9266-2-rkrcmar@redhat.com> <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> In-Reply-To: <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: David Hildenbrand Cc: Radim =?UTF-8?B?S3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mips@linux-mips.org, kvm-ppc@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paolo Bonzini , Christoffer Dall , Marc Zyngier , Christian Borntraeger , James Hogan , Paul Mackerras , Alexander Graf On Tue, 22 Aug 2017 13:31:27 +0200 David Hildenbrand wrote: > On 21.08.2017 22:35, Radim Krčmář wrote: > > We can add a variable instead of scanning all online VCPUs to know how > > many are started. We can't trivially tell which VCPU is the last one, > > though. > > You could keep the started vcpus in a list. Then you might drop unsigned > started_vcpus; > > No started vcpus: Start pointer NULL > Single started vcpu: Only one element in the list (easy to check) > > 1 started vcpus: More than one element int he list (easy to check) I'm not sure the added complication of keeping a list buys us much here: We only have the "look for the last vcpu not stopped" operation for the 2->1 transition. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 29 Aug 2017 13:24:11 +0200 (CEST) Received: from mx1.redhat.com ([209.132.183.28]:51874 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23994929AbdH2LXyTaWk4 convert rfc822-to-8bit (ORCPT ); Tue, 29 Aug 2017 13:23:54 +0200 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FD24404318; Tue, 29 Aug 2017 11:23:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8FD24404318 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com Received: from gondolin (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 067D86FDDC; Tue, 29 Aug 2017 11:23:44 +0000 (UTC) Date: Tue, 29 Aug 2017 13:23:42 +0200 From: Cornelia Huck To: David Hildenbrand Cc: Radim =?UTF-8?B?S3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mips@linux-mips.org, kvm-ppc@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paolo Bonzini , Christoffer Dall , Marc Zyngier , Christian Borntraeger , James Hogan , Paul Mackerras , Alexander Graf Subject: Re: [PATCH RFC v3 1/9] KVM: s390: optimize detection of started vcpus Message-ID: <20170829132342.1ef25500.cohuck@redhat.com> In-Reply-To: <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> References: <20170821203530.9266-1-rkrcmar@redhat.com> <20170821203530.9266-2-rkrcmar@redhat.com> <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 29 Aug 2017 11:23:47 +0000 (UTC) Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 59857 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: cohuck@redhat.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips On Tue, 22 Aug 2017 13:31:27 +0200 David Hildenbrand wrote: > On 21.08.2017 22:35, Radim Krčmář wrote: > > We can add a variable instead of scanning all online VCPUs to know how > > many are started. We can't trivially tell which VCPU is the last one, > > though. > > You could keep the started vcpus in a list. Then you might drop unsigned > started_vcpus; > > No started vcpus: Start pointer NULL > Single started vcpu: Only one element in the list (easy to check) > > 1 started vcpus: More than one element int he list (easy to check) I'm not sure the added complication of keeping a list buys us much here: We only have the "look for the last vcpu not stopped" operation for the 2->1 transition. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH RFC v3 1/9] KVM: s390: optimize detection of started vcpus Date: Tue, 29 Aug 2017 13:23:42 +0200 Message-ID: <20170829132342.1ef25500.cohuck@redhat.com> References: <20170821203530.9266-1-rkrcmar@redhat.com> <20170821203530.9266-2-rkrcmar@redhat.com> <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Archive: List-Post: To: David Hildenbrand Cc: linux-mips@linux-mips.org, James Hogan , kvm@vger.kernel.org, linux-s390@vger.kernel.org, Marc Zyngier , Radim =?UTF-8?B?S3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, Christoffer Dall , Christian Borntraeger , Alexander Graf , Paul Mackerras , Paolo Bonzini , linux-arm-kernel@lists.infradead.org List-ID: T24gVHVlLCAyMiBBdWcgMjAxNyAxMzozMToyNyArMDIwMApEYXZpZCBIaWxkZW5icmFuZCA8ZGF2 aWRAcmVkaGF0LmNvbT4gd3JvdGU6Cgo+IE9uIDIxLjA4LjIwMTcgMjI6MzUsIFJhZGltIEtyxI1t w6HFmSB3cm90ZToKPiA+IFdlIGNhbiBhZGQgYSB2YXJpYWJsZSBpbnN0ZWFkIG9mIHNjYW5uaW5n IGFsbCBvbmxpbmUgVkNQVXMgdG8ga25vdyBob3cKPiA+IG1hbnkgYXJlIHN0YXJ0ZWQuICBXZSBj YW4ndCB0cml2aWFsbHkgdGVsbCB3aGljaCBWQ1BVIGlzIHRoZSBsYXN0IG9uZSwKPiA+IHRob3Vn aC4gIAo+IAo+IFlvdSBjb3VsZCBrZWVwIHRoZSBzdGFydGVkIHZjcHVzIGluIGEgbGlzdC4gVGhl biB5b3UgbWlnaHQgZHJvcCB1bnNpZ25lZAo+IHN0YXJ0ZWRfdmNwdXM7Cj4gCj4gTm8gc3RhcnRl ZCB2Y3B1czogU3RhcnQgcG9pbnRlciBOVUxMCj4gU2luZ2xlIHN0YXJ0ZWQgdmNwdTogT25seSBv bmUgZWxlbWVudCBpbiB0aGUgbGlzdCAoZWFzeSB0byBjaGVjaykKPiA+IDEgc3RhcnRlZCB2Y3B1 czogTW9yZSB0aGFuIG9uZSBlbGVtZW50IGludCBoZSBsaXN0IChlYXN5IHRvIGNoZWNrKSAgCgpJ J20gbm90IHN1cmUgdGhlIGFkZGVkIGNvbXBsaWNhdGlvbiBvZiBrZWVwaW5nIGEgbGlzdCBidXlz IHVzIG11Y2gKaGVyZTogV2Ugb25seSBoYXZlIHRoZSAibG9vayBmb3IgdGhlIGxhc3QgdmNwdSBu b3Qgc3RvcHBlZCIgb3BlcmF0aW9uCmZvciB0aGUgMi0+MSB0cmFuc2l0aW9uLgoKX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGludXgtYXJtLWtlcm5lbCBt YWlsaW5nIGxpc3QKbGludXgtYXJtLWtlcm5lbEBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9s aXN0cy5pbmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtYXJtLWtlcm5lbAo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: cohuck@redhat.com (Cornelia Huck) Date: Tue, 29 Aug 2017 13:23:42 +0200 Subject: [PATCH RFC v3 1/9] KVM: s390: optimize detection of started vcpus In-Reply-To: <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> References: <20170821203530.9266-1-rkrcmar@redhat.com> <20170821203530.9266-2-rkrcmar@redhat.com> <67a8b09c-3e7a-943d-8684-f9ad6e70514b@redhat.com> Message-ID: <20170829132342.1ef25500.cohuck@redhat.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 22 Aug 2017 13:31:27 +0200 David Hildenbrand wrote: > On 21.08.2017 22:35, Radim Kr?m?? wrote: > > We can add a variable instead of scanning all online VCPUs to know how > > many are started. We can't trivially tell which VCPU is the last one, > > though. > > You could keep the started vcpus in a list. Then you might drop unsigned > started_vcpus; > > No started vcpus: Start pointer NULL > Single started vcpu: Only one element in the list (easy to check) > > 1 started vcpus: More than one element int he list (easy to check) I'm not sure the added complication of keeping a list buys us much here: We only have the "look for the last vcpu not stopped" operation for the 2->1 transition.