From: Avi Kivity <avi@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] Really lazy fpu
Date: Wed, 16 Jun 2010 11:02:47 +0300 [thread overview]
Message-ID: <4C188527.9040305@redhat.com> (raw)
In-Reply-To: <4C187DF1.9030007@zytor.com>
On 06/16/2010 10:32 AM, H. Peter Anvin wrote:
> On 06/16/2010 12:24 AM, Avi Kivity wrote:
>
>> Ingo, Peter, any feedback on this?
>>
> Conceptually, this makes sense to me. However, I have a concern what
> happens when a task is scheduled on another CPU, while its FPU state is
> still in registers in the original CPU. That would seem to require
> expensive IPIs to spill the state in order for the rescheduling to
> proceed, and this could really damage performance.
>
Right, this optimization isn't free.
I think the tradeoff is favourable since task migrations are much less
frequent than context switches within the same cpu, can the scheduler
experts comment?
We can also mitigate some of the IPIs if we know that we're migrating on
the cpu we're migrating from (i.e. we're pushing tasks to another cpu,
not pulling them from their cpu). Is that a common case, and if so,
where can I hook a call to unlazy_fpu() (or its new equivalent)?
Note that kvm on intel has exactly the same issue (the VMPTR and VMCS
are on-chip registers that are expensive to load and save, so we keep
them loaded even while not scheduled, and IPI if we notice we've
migrated; note that architecturally the cpu can cache multiple VMCSs
simultaneously (though I doubt they cache multiple VMCSs
microarchitecturally at this point)).
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-06-16 8:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-13 15:03 [PATCH 0/4] Really lazy fpu Avi Kivity
2010-06-13 15:03 ` [PATCH 1/4] x86, fpu: merge __save_init_fpu() implementations Avi Kivity
2010-06-13 15:03 ` [PATCH 2/4] x86, fpu: run device not available trap with interrupts enabled Avi Kivity
2010-06-13 15:03 ` [PATCH 3/4] x86, fpu: Let the fpu remember which cpu it is active on Avi Kivity
2010-06-13 15:03 ` [PATCH 4/4] x86, fpu: don't save fpu state when switching from a task Avi Kivity
2010-06-13 20:45 ` [PATCH 0/4] Really lazy fpu Valdis.Kletnieks
2010-06-14 7:47 ` Avi Kivity
2010-06-16 7:24 ` Avi Kivity
2010-06-16 7:32 ` H. Peter Anvin
2010-06-16 8:02 ` Avi Kivity [this message]
2010-06-16 8:39 ` Ingo Molnar
2010-06-16 9:01 ` Samuel Thibault
2010-06-16 9:43 ` Avi Kivity
2010-06-16 9:10 ` Nick Piggin
2010-06-16 9:30 ` Avi Kivity
2010-06-16 9:28 ` Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2010-06-16 11:32 George Spelvin
2010-06-16 11:46 ` Avi Kivity
2010-06-17 9:38 ` George Spelvin
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=4C188527.9040305@redhat.com \
--to=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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).