From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35465 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PINkZ-0006Ol-Kp for qemu-devel@nongnu.org; Tue, 16 Nov 2010 10:47:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PINkY-00019a-G1 for qemu-devel@nongnu.org; Tue, 16 Nov 2010 10:47:15 -0500 Received: from mail-iw0-f173.google.com ([209.85.214.173]:58199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PINkY-00019S-D7 for qemu-devel@nongnu.org; Tue, 16 Nov 2010 10:47:14 -0500 Received: by iwn36 with SMTP id 36so973566iwn.4 for ; Tue, 16 Nov 2010 07:47:13 -0800 (PST) Message-ID: <4CE2A77F.7040008@codemonkey.ws> Date: Tue, 16 Nov 2010 09:47:11 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH RESEND] apic: Don't iterate past last used apic References: <20101105220128.26044.11658.stgit@s20.home> In-Reply-To: <20101105220128.26044.11658.stgit@s20.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: qemu-devel@nongnu.org On 11/05/2010 05:01 PM, Alex Williamson wrote: > local_apics are allocated sequentially and never removed, so > we can stop any iterations that go to MAX_APICS as soon as we > hit the first NULL. Looking at a small guest running a virtio-net > workload with oprofile, this drops apic_get_delivery_bitmask() > from #3 in the profile to down in the noise. > > Signed-off-by: Alex Williamson > Applied. Thanks. Regards, Anthony LIguori > --- > > hw/apic.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/hw/apic.c b/hw/apic.c > index 63d62c7..5f4a87c 100644 > --- a/hw/apic.c > +++ b/hw/apic.c > @@ -437,6 +437,8 @@ static int apic_find_dest(uint8_t dest) > apic = local_apics[i]; > if (apic&& apic->id == dest) > return i; > + if (!apic) > + break; > } > > return -1; > @@ -472,6 +474,8 @@ static void apic_get_delivery_bitmask(uint32_t *deliver_bitmask, > set_bit(deliver_bitmask, i); > } > } > + } else { > + break; > } > } > } > > > >