Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-10 Thread Avi Kivity
Avi Kivity wrote: The congruent case which comes to mind is lazy FPU handling. That one has preempt_ops in hardware: cr0.ts and #NM. However, that doesn't handle in-kernel use of the fpu. kernel_fpu_begin()/kernel_fpu_end() could easily be modified to take advantage of a generic preem

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-10 Thread Avi Kivity
Rusty Russell wrote: On Tue, 2007-07-10 at 10:19 +0300, Avi Kivity wrote: Rusty Russell wrote: Exactly, if we have two at the same time, they need to know about each other. Providing infrastructure which lets them avoid thinking about it is the wrong direction. With a kvm-spe

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-10 Thread Rusty Russell
On Tue, 2007-07-10 at 10:19 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > Exactly, if we have two at the same time, they need to know about each > > other. Providing infrastructure which lets them avoid thinking about it > > is the wrong direction. > > > > With a kvm-specific hook, they

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-10 Thread Avi Kivity
Rusty Russell wrote: On Tue, 2007-07-10 at 08:53 +0300, Avi Kivity wrote: Rusty Russell wrote: No; this is a "I'm doing something magic and need to know before someone else takes the CPU". Almost by definition, you cannot have two of them at the same time. Let someone else try that if

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-09 Thread Rusty Russell
On Tue, 2007-07-10 at 08:53 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > No; this is a "I'm doing something magic and need to know before someone > > else takes the CPU". Almost by definition, you cannot have two of them > > at the same time. Let someone else try that if and when... > > W

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-09 Thread Avi Kivity
Rusty Russell wrote: > On Mon, 2007-07-09 at 09:39 +0300, Avi Kivity wrote: > >> Rusty Russell wrote: >> >>> I think a "struct preempt_ops *" and a "void *preempt_ops_data" inside >>> every task struct is a better idea. Call the config option >>> PREEMPT_SCHED_HOOKS and now there's nothing

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-09 Thread Rusty Russell
On Mon, 2007-07-09 at 09:39 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > I think a "struct preempt_ops *" and a "void *preempt_ops_data" inside > > every task struct is a better idea. Call the config option > > PREEMPT_SCHED_HOOKS and now there's nothing kvm-specific about it... > > > >

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
Rusty Russell wrote: > On Sun, 2007-07-08 at 15:48 +0200, Ingo Molnar wrote: > >> * Avi Kivity <[EMAIL PROTECTED]> wrote: >> >> > +#ifdef CONFIG_SCHED_KVM > +static __read_mostly struct sched_kvm_hooks kvm_hooks; > +#endif > please just add a current->put_vcp

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Rusty Russell
On Sun, 2007-07-08 at 15:48 +0200, Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > > >>+#ifdef CONFIG_SCHED_KVM > > >>+static __read_mostly struct sched_kvm_hooks kvm_hooks; > > >>+#endif > > > > > >please just add a current->put_vcpu() function pointer instead of > > >this hooks