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.