From: Avi Kivity <avi@qumranet.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Virtualization Mailing List <virtualization@lists.osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@suse.de>, Zachary Amsden <zach@vmware.com>,
Rusty Russell <rusty@rustcorp.com.au>,
Anthony Liguori <anthony@codemonkey.ws>,
Glauber de Oliveira Costa <glommer@gmail.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [PATCH RFC] paravirt: cleanup lazy mode handling
Date: Tue, 02 Oct 2007 07:48:41 +0200 [thread overview]
Message-ID: <4701DBB9.9020202@qumranet.com> (raw)
In-Reply-To: <470186C4.5080208@goop.org>
Jeremy Fitzhardinge wrote:
> Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
> 1. enter lazy cpu mode
> 2. leave lazy cpu mode
> 3. enter lazy mmu mode
> 4. leave lazy mmu mode
> 5. flush pending batched operations
>
> This complicates each paravirt backend, since it needs to deal with
> all the possible state transitions, handling flushing, etc. In
> particular, flushing is quite distinct from the other 4 functions, and
> seems to just cause complication.
>
> This patch removes the set_lazy_mode operation, and adds "enter" and
> "leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
> associated with enter and leaving lazy states is now in common code
> (basically BUG_ONs to make sure that no mode is current when entering
> a lazy mode, and make sure that the mode is current when leaving).
> Also, flush is handled in a common way, by simply leaving and
> re-entering the lazy mode.
>
> The result is that the Xen and VMI lazy mode implementations are much
> simpler; as would lguest's be.
>
>
The code doesn't support having both lazy modes active at once. Maybe
that's not an issue, but aren't the two modes orthogonal?
> --- a/arch/i386/xen/multicalls.h
> +++ b/arch/i386/xen/multicalls.h
> @@ -35,7 +35,7 @@ void xen_mc_flush(void);
> /* Issue a multicall if we're not in a lazy mode */
> static inline void xen_mc_issue(unsigned mode)
> {
> - if ((xen_get_lazy_mode() & mode) == 0)
> + if ((paravirt_get_lazy_mode() & mode) == 0)
> xen_mc_flush();
This snippet looks like it wants to support concurrently active lazy modes.
--
Any sufficiently difficult bug is indistinguishable from a feature.
next prev parent reply other threads:[~2007-10-02 5:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 23:46 [PATCH RFC] paravirt: cleanup lazy mode handling Jeremy Fitzhardinge
2007-10-02 1:34 ` Rusty Russell
2007-10-02 6:29 ` Jeremy Fitzhardinge
2007-10-02 7:53 ` Rusty Russell
2007-10-02 22:43 ` Jeremy Fitzhardinge
2007-10-02 5:48 ` Avi Kivity [this message]
2007-10-02 6:24 ` Jeremy Fitzhardinge
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=4701DBB9.9020202@qumranet.com \
--to=avi@qumranet.com \
--cc=ak@suse.de \
--cc=anthony@codemonkey.ws \
--cc=glommer@gmail.com \
--cc=jeremy@goop.org \
--cc=jun.nakajima@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.osdl.org \
--cc=zach@vmware.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).