Re: [PATCH 1/2] SCHED: Generic hooks for trapping task preemption

2007-07-11 Thread Avi Kivity
Rusty Russell wrote: > On Wed, 2007-07-11 at 18:55 +0300, Avi Kivity wrote: > >> +fire_sched_out_preempt_hooks(current); >> prepare_lock_switch(rq, next); >> prepare_arch_switch(next); >> > > Damn, I just found a use for this in lguest. > > Any chance of handing "next" to the

Re: [PATCH 1/2] SCHED: Generic hooks for trapping task preemption

2007-07-11 Thread Rusty Russell
On Wed, 2007-07-11 at 18:55 +0300, Avi Kivity wrote: > + fire_sched_out_preempt_hooks(current); > prepare_lock_switch(rq, next); > prepare_arch_switch(next); Damn, I just found a use for this in lguest. Any chance of handing "next" to the sched_out hook so we can optimize the lgue

Re: [PATCH 1/2] SCHED: Generic hooks for trapping task preemption

2007-07-11 Thread Rusty Russell
On Wed, 2007-07-11 at 18:55 +0300, Avi Kivity wrote: > +config PREEMPT_HOOKS > + bool > + depends on X86 > + default y Hmm, I would have thought that having CONFIG_KVM "select PREEMPT_HOOKS" would be a little clearer. > +static void fire_sched_in_preempt_hooks(struct task_struct *tsk)

[PATCH 1/2] SCHED: Generic hooks for trapping task preemption

2007-07-11 Thread Avi Kivity
This adds a general mechanism whereby a task can request the scheduler to notify it whenever it is preempted or scheduled back in. This allows the task to swap any special-purpose registers like the fpu or Intel's VT registers. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- include/linux/pree