From: Hollis Blanchard Date: Fri, 10 Oct 2008 18:07:21 +0000 Subject: Re: [PATCH 1/3] kvmppc: optimize irq delivery path Message-Id: <1223662041.3351.16.camel@localhost.localdomain> List-Id: References: <1223636372-8946-3-git-send-email-ehrhardt@linux.vnet.ibm.com> In-Reply-To: <1223636372-8946-3-git-send-email-ehrhardt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Fri, 2008-10-10 at 12:59 +0200, ehrhardt@linux.vnet.ibm.com wrote: > From: Christian Ehrhardt > > In kvmppc_deliver_interrupt is just one case left in the switch and it is a > rare one (less than 8%) when looking at the exit numbers. Therefore we can > at least drop the switch/case and if an if. I inserted an unlikely too, but > that's open for discussion. > > In kvmppc_can_deliver_interrupt all frequent cases are in the default case. > I know compilers are smart but we can make it easier for them. By writing > down all options and removing the default case combined with the fact that > ithe values are constants 0..15 should allow the compiler to write an easy > jump table. > Modifying kvmppc_can_deliver_interrupt pointed me to the fact that gcc seems > to be unable to reduce priority_exception[x] to a build time constant. > Therefore I changed the usage of the translation arrays in the interrupt > delivery path completely. It is now using priority without translation to irq > on the full irq delivery path. > To be able to do that ivpr regs are stored by their priority now. I like this, but a few notes: Why did you convert exception_priority[] to int? AFAICS it still only holds values 0-15, and using chars would shrink it from 2 32-byte cachelines (3 unaligned) to half of one. It looks like you applied this on top of the pvmem patches. I guess the performance benefit is significant enough to apply those, but I'll have to find the patches again. I think the IVOR emulation has gotten wide enough that you can add some newlines. AFAICS the *_PRIO constants aren't used in assembly, so do they need to go into kvm_asm.h? -- Hollis Blanchard IBM Linux Technology Center