From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch] remove vcpu_info array v5 Date: Tue, 04 Nov 2008 16:30:45 +0200 Message-ID: <49105C95.90809@redhat.com> References: <4909C00F.8050704@sgi.com> <49103812.1070104@redhat.com> <5d6222a80811040555q5be67439sbd38d94dfa25d8ad@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Jes Sorensen , Anthony Liguori , Hollis Blanchard , "kvm@vger.kernel.org" , "kvm-ia64@vger.kernel.org" To: Glauber Costa Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39899 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754254AbYKDOaw (ORCPT ); Tue, 4 Nov 2008 09:30:52 -0500 In-Reply-To: <5d6222a80811040555q5be67439sbd38d94dfa25d8ad@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Glauber Costa wrote: >> This can't be the best way of determining the env pointer from a cpu number. >> > By far it is not. But at least it does not depend on any kvm-specific > data, and works > for both qemu and kvm. So it's better to be this way. > > If we change this scheme to a better one, like a hash table, then > it'll improve both qemu and kvm. > > There are simpler data structures. An example is an array. Since we have an upper limit on the number of cpus (->max_cpus) there are no issues with scaling (unlike with the algorithm above). -- error compiling committee.c: too many arguments to function