kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	kvm@vger.kernel.org, Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm: optimize ISR lookups
Date: Mon, 21 May 2012 16:12:21 -0700	[thread overview]
Message-ID: <4FBACBD5.6080207@zytor.com> (raw)
In-Reply-To: <20120521230623.GO17031@redhat.com>

On 05/21/2012 04:06 PM, Michael S. Tsirkin wrote:
> 
> I think the reason is __apic_read which now simply copies the registers
> out to guest, this code will become less straight-forward if it's not
> 1:1.
> 

It can still be 1:1, just drop the 12 bytes of completely useless
padding after each 32-bit datum.

>> And if you look deeper, then you'll notice that _ALL_ APIC registers
>> are on a 16 byte boundary (thanks Peter for pointing that out).
>>
>> So it's even more silly to have a 1:1 representation instead of
>> implementing the default emulated apic_read/write functions to access
>> (offset >> 2).
>>
>> And of course, that design decision causes lookups to be slow.
> 
> Yes, it might be one of the reasons why my patch helps so
> much: it adds a cache in front of this data structure.
> 

Well, *fix the fscking data structure first*.

> 
> So what you propose is in fact to rework apic registers at least for
> ISR,IRR,TMR to use a bitmap.
> I am fine with this suggestion but would like some feedback from kvm
> maintainers on where they want to go before I spend time on that.
> 

This should be a 20-minute hack.

	-hpa

  reply	other threads:[~2012-05-21 23:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21 16:37 [PATCH] kvm: optimize ISR lookups Michael S. Tsirkin
2012-05-21 18:44 ` Michael S. Tsirkin
2012-05-21 21:04 ` Thomas Gleixner
2012-05-21 21:51   ` Michael S. Tsirkin
2012-05-21 22:14     ` Thomas Gleixner
2012-05-21 22:24       ` Michael S. Tsirkin
2012-05-21 22:44         ` Thomas Gleixner
2012-05-21 22:50           ` Michael S. Tsirkin
2012-05-21 23:01         ` Thomas Gleixner
2012-05-22 10:46           ` Avi Kivity
2012-05-23 14:48             ` Ingo Molnar
2012-05-23 15:03               ` Avi Kivity
2012-05-23 20:10                 ` Thomas Gleixner
2012-05-23 20:46                   ` Michael S. Tsirkin
2012-05-23 23:02                     ` Thomas Gleixner
2012-05-23 15:14               ` Michael S. Tsirkin
2012-05-23 19:22                 ` H. Peter Anvin
2012-05-21 23:11         ` Thomas Gleixner
2012-05-21 23:06   ` Michael S. Tsirkin
2012-05-21 23:12     ` H. Peter Anvin [this message]
2012-05-21 23:36     ` Thomas Gleixner
2012-05-22 10:59   ` Avi Kivity
2012-05-22 17:26     ` Thomas Gleixner
2012-05-23 15:10       ` Avi Kivity
2012-05-23 18:37         ` Thomas Gleixner
2012-05-23 19:25           ` H. Peter Anvin
2012-05-23 22:00             ` Thomas Gleixner
2012-05-30 14:18               ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FBACBD5.6080207@zytor.com \
    --to=hpa@zytor.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).