From: Yang Zhang <yang.zhang.wz@gmail.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Rik van Riel <riel@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
pbonzini@redhat.com, mtosatti@redhat.com, bsd@redhat.com
Subject: Re: [PATCH] kvm: x86: make lapic hrtimer pinned
Date: Thu, 7 Apr 2016 10:08:00 +0800 [thread overview]
Message-ID: <5705C100.7000001@gmail.com> (raw)
In-Reply-To: <20160405155438.GD21537@potion.brq.redhat.com>
On 2016/4/5 23:54, Radim Krčmář wrote:
> 2016-04-05 14:18+0800, Yang Zhang:
>> On 2016/4/5 5:00, Rik van Riel wrote:
>>> Given that delivering a timer to a guest seems to
>>> involve trapping from the guest to the host, anyway,
>>> I don't see a downside to your patch.
>>>
>>> If that is ever changed (eg. allowing delivery of
>>> a timer interrupt to a VCPU without trapping to the
>>> host), we may want to revisit this.
>>
>> Posted interrupt helps in this case. Currently, KVM doesn't use PI for lapic
>> timer is due to same affinity for lapic timer and VCPU. Now, we can change
>> to use PI for lapic timer. The only concern is what's frequency of timer
>> migration in upstream Linux? If it is frequently, will it bring additional
>> cost?
>
> It's a scheduler bug if the timer migration frequency would matter. :)
> Additional costs arise when the timer and VCPU are on two different
> CPUs. (e.g. if both CPUs are in deep C-state, we wasted one wakeup;
> the timer would sometimes needs to send an interrupt.)
Yes, it's possible. But the premise is VCPU is pinned to other CPU.
Normally, the VCPU will wake up on the same CPU where timer interrupt is
stay if CPU is idle.
>
> Fine tuned KVM could benefit from having the lapic timer backend on a
> different physical core, but the general case would need some experience
> to decide.
>
> I think that we'd still want to have timer interrupts on the same
> physical core if the host didn't have PI, and the fraction of timers
> that can be injected without a guest entry is important to decide
> whether PI can make the effort worthwhile.
Agree. I can do some experiences to see how much improvement we can get.
>
> The biggest benefit might come from handling multiple lapic timers in
> one host interrupt.
This is should be another story.We need to align multiple lapic timers
into one timer firstly.:)
--
best regards
yang
next prev parent reply other threads:[~2016-04-07 2:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 20:46 [PATCH] kvm: x86: make lapic hrtimer pinned Luiz Capitulino
2016-04-04 21:00 ` Rik van Riel
2016-04-05 6:18 ` Yang Zhang
2016-04-05 12:40 ` Luiz Capitulino
2016-04-21 23:12 ` Wanpeng Li
2016-04-22 13:12 ` Luiz Capitulino
2016-04-23 23:06 ` Wanpeng Li
2016-04-05 15:54 ` Radim Krčmář
2016-04-07 2:08 ` Yang Zhang [this message]
2016-04-05 10:05 ` Paolo Bonzini
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=5705C100.7000001@gmail.com \
--to=yang.zhang.wz@gmail.com \
--cc=bsd@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=riel@redhat.com \
--cc=rkrcmar@redhat.com \
/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).