From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUAbq-00020C-M1 for qemu-devel@nongnu.org; Fri, 12 Feb 2016 05:05:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUAbn-0002Xf-Cx for qemu-devel@nongnu.org; Fri, 12 Feb 2016 05:05:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUAbn-0002XS-7V for qemu-devel@nongnu.org; Fri, 12 Feb 2016 05:05:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id C6F0AE1B60 for ; Fri, 12 Feb 2016 10:05:50 +0000 (UTC) Date: Fri, 12 Feb 2016 11:05:48 +0100 From: Igor Mammedov Message-ID: <20160212110548.5c0ad728@nial.brq.redhat.com> In-Reply-To: <20160211155933.GB6239@thinpad.lan.raisama.net> References: <1454586455-10202-1-git-send-email-imammedo@redhat.com> <1454586455-10202-7-git-send-email-imammedo@redhat.com> <20160205153907.GS26314@thinpad.lan.raisama.net> <20160205171950.4bf5ea3a@nial.brq.redhat.com> <20160205174449.4dd18057@nial.brq.redhat.com> <20160211155933.GB6239@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/9] pc: acpi: drop not needed intermediate bitmap cpu->found_cpus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, mst@redhat.com On Thu, 11 Feb 2016 13:59:33 -0200 Eduardo Habkost wrote: > On Fri, Feb 05, 2016 at 05:44:49PM +0100, Igor Mammedov wrote: > > On Fri, 5 Feb 2016 17:19:50 +0100 > > Igor Mammedov wrote: > > > > > On Fri, 5 Feb 2016 13:39:07 -0200 > > > Eduardo Habkost wrote: > > > > > > > On Thu, Feb 04, 2016 at 12:47:33PM +0100, Igor Mammedov wrote: > > > > > cpu->found_cpus bitmap is used for setting present > > > > > flag in CPON AML package at start up. But it takes > > > > > a bunch of code to fill bitmap and cloud be simplified > > > > > by calling qemu_get_cpu_by_arch_id(apic_id) directly. > > > > > > > > > > Hence do so and remove not used anymore bitmap > > > > > with related utilities, which saves us ~32LOC > > > > > and also would simplify consolidating APCI parts > > > > > of CPU hotplug. > > > > > > > > > > Signed-off-by: Igor Mammedov > > > > > > > > This makes the code loops through all smp_cpus CPUs max_cpus > > > > times, instead of just looping through the smp_cpus CPUs once. > > > Yep, that looks bad. > > > I'll redo it using possible_cpu_arch_ids(), it is a little > > > bit bigger refactoring. > > I think I'll make bitmap local to build_processor_devices() as it's > > needed only for building CPON package, that way it will go along > > with related legacy hotplug and won't get in the way of new hotplug. > > What about pc_possible_cpu_arch_ids() itself? It has exactly the > same problem: it looks at CPU objects smp_cpus*max_cpus times, to > fill the CPUArchId.cpu field. If that's a problem for > build_processor_devices(), I assume that's a problem for all > other possible_cpu_arch_ids() callers? pls see v2 https://www.mail-archive.com/qemu-devel@nongnu.org/msg351298.html