Re: [PATCH RFC] paravirt: cleanup lazy mode handling

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeremy Fitzhardinge <jeremy@...>
Cc: Virtualization Mailing List <virtualization@...>, Linux Kernel Mailing List <linux-kernel@...>, Andi Kleen <ak@...>, Zachary Amsden <zach@...>, Avi Kivity <avi@...>, Anthony Liguori <anthony@...>, Glauber de Oliveira Costa <glommer@...>, Nakajima, Jun <jun.nakajima@...>
Date: Tuesday, October 2, 2007 - 3:53 am

On Mon, 2007-10-01 at 23:29 -0700, Jeremy Fitzhardinge wrote: 

No, they're helpers.  eg:

static void lguest_exit_lazy(enum paravirt_lazy_mode mode)
{
paravirt_exit_lazy(mode);
lguest_flush_hcalls();
}


Probably overkill (I was trying to avoid the branch for the case where
we don't need to flush, as that's always what happens).

So just expose a flush hook:

static inline void arch_flush_lazy_cpu_mode(void)
{
	PVOP_VCALL1(flush_lazy_mode, PARAVIRT_LAZY_CPU);
}

....

static void lguest_flush_lazy_mode(enum paravirt_lazy_mode mode)
{
	if (unlikely(x86_read_percpu(paravirt_lazy_mode) == mode)) {
		lguest_lazy_cpu_leave();
		lguest_lazy_cpu_enter();
	}
}

Cheers,
Rusty.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC] paravirt: cleanup lazy mode handling, Jeremy Fitzhardinge, (Mon Oct 1, 7:46 pm)
Re: [PATCH RFC] paravirt: cleanup lazy mode handling, Jeremy Fitzhardinge, (Tue Oct 2, 2:24 am)
Re: [PATCH RFC] paravirt: cleanup lazy mode handling, Rusty Russell, (Mon Oct 1, 9:34 pm)
Re: [PATCH RFC] paravirt: cleanup lazy mode handling, Jeremy Fitzhardinge, (Tue Oct 2, 2:29 am)
Re: [PATCH RFC] paravirt: cleanup lazy mode handling, Rusty Russell, (Tue Oct 2, 3:53 am)
Re: [PATCH RFC] paravirt: cleanup lazy mode handling, Jeremy Fitzhardinge, (Tue Oct 2, 6:43 pm)