From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: APIC lookups Date: Fri, 2 Sep 2011 21:13:23 +0300 Message-ID: <20110902181323.GJ26451@redhat.com> References: <1314986155.31676.22.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm To: Sasha Levin Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753643Ab1IBSNZ (ORCPT ); Fri, 2 Sep 2011 14:13:25 -0400 Content-Disposition: inline In-Reply-To: <1314986155.31676.22.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 02, 2011 at 08:55:55PM +0300, Sasha Levin wrote: > Hi, > > I've noticed that kvm_irq_delivery_to_apic() is locating the destination > APIC by running through kvm_for_each_vcpu() which becomes a scalability > issue with a large number if vcpus. > > I'm thinking about speeding that up using a radix tree for lookups, and > was wondering if it sounds right. > We have to call kvm_apic_match_dest() on each apic to see if it should get the message. Single message can be sent to more than one apic. It is likely possible to optimize common case of physical addressing fixed destination, but then just use array of 256 elements, no need for a tree. Do you see this function in profiling? -- Gleb.