From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch] remove vcpu_info array v5 Date: Mon, 10 Nov 2008 17:45:15 +0200 Message-ID: <4918570B.4030603@redhat.com> References: <4909C00F.8050704@sgi.com> <49103812.1070104@redhat.com> <5d6222a80811040555q5be67439sbd38d94dfa25d8ad@mail.gmail.com> <49105C95.90809@redhat.com> <5d6222a80811040635j70c57efev1f3abc5096803b29@mail.gmail.com> <49105ED8.107@redhat.com> <4918376D.6060201@sgi.com> <491839CF.9060105@redhat.com> <491851CD.9030401@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jes Sorensen , Glauber Costa , Hollis Blanchard , "kvm@vger.kernel.org" , "kvm-ia64@vger.kernel.org" To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:56225 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954AbYKJPp0 (ORCPT ); Mon, 10 Nov 2008 10:45:26 -0500 In-Reply-To: <491851CD.9030401@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Anthony Liguori wrote: > > Just do a linear search of the CPUState list and be done with it. > This smells of premature optimization greatly. I would be amazed if > walking the CPUState list is ever on the fast path or will ever be. > Really, if you need to go from cpu_index => CPUState, it suggests > you're doing something wrong. > apic_bus_deliver() in hw/apic.c (it uses a static array of local apics, but under you proposal it would need to be converted to a list as well). happens once per interrupt. With external interrupts you might precompute it, but IPIs definitely need fast int->ptr conversion. -- error compiling committee.c: too many arguments to function