From: "Jan Beulich" <JBeulich@novell.com>
To: Wei Huang <wei.huang2@amd.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
KeirFraser <keir@xen.org>
Subject: Re: Re: [PATCH] FPU LWP 6/8: create lazy and non-lazy FPU restore functions
Date: Fri, 06 May 2011 08:49:18 +0100 [thread overview]
Message-ID: <4DC3C41E020000780003FFB2@vpn.id2.novell.com> (raw)
In-Reply-To: <4DC31973.8040009@amd.com>
>>> On 05.05.11 at 23:41, Wei Huang <wei.huang2@amd.com> wrote:
> Hi Jan,
>
> If we want to make LWP restore optional in vcpu_restore_fpu_eager(), we
> have to change vcpu_save_fpu() as well. Otherwise, the extended state
> will become inconsistent for non-LWP VCPUs (because save and restore is
> asymmetric). There are two approaches:
>
> 1. In vcpu_save_fpu(), clean physical CPU's extended state for VCPU
> which is being scheduled in. This prevents messy states from causing
> problems. The disadvantage is the cleaning cost, which would out-weight
> the benefits.
Cleaning cost? Wasn't it that one can express to default-initialize
fields during xrstor (which, if indeed expensive, you'd want to trigger
only if you know the physical CPU's state is dirty, i.e. in this case
requiring a per-CPU variable that gets evaluated and updated on
context restore).
> 2. Add a new variable in VCPU to track whether nonlazy state is dirty. I
> think this is better. See the attached file.
>
> Let me know if it is what you want. After that, I will re-spin the patches.
Yes, this looks like what I meant. Two suggestions: The new field's
name (nonlazy_xstate_dirty) would perhaps better be something
like nonlazy_xstate_used, so that name and use are in sync. And
the check in vcpu_restore_fpu_eager() probably doesn't need to
re-evaluate xsave_enabled(v), since the flag can't get set without
this (if you absolutely want to, put in an ASSERT() to this effect).
Jan
prev parent reply other threads:[~2011-05-06 7:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-03 20:17 [PATCH] FPU LWP 6/8: create lazy and non-lazy FPU restore functions Wei Huang
2011-05-04 7:09 ` Jan Beulich
2011-05-04 16:33 ` Wei Huang
2011-05-05 7:13 ` Jan Beulich
2011-05-05 21:41 ` Wei Huang
2011-05-06 7:49 ` Jan Beulich [this message]
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=4DC3C41E020000780003FFB2@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=keir@xen.org \
--cc=wei.huang2@amd.com \
--cc=xen-devel@lists.xensource.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).