Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-22 Thread Wanpeng Li
On 10/21/15 2:46 PM, Paolo Bonzini wrote: On 21/10/2015 00:57, Wanpeng Li wrote: kvm_sched_out and kvm_sched_in are part of KVM's preemption hooks. The hooks are registered only between vcpu_load and vcpu_put, therefore they know that the mutex is taken. The sequence will go like this:

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-22 Thread Paolo Bonzini
On 21/10/2015 19:21, Yacine HEBBAL wrote: > If I correctly understood you last paragraph, it is better to use vm_ioctl > to do generic processing that doesn't rely on a given VCPU and hence I won't > need to use "CPU_FOREACH, run_on_cpu and current_cpu". Right. On the other hand, you

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Yacine HEBBAL
Paolo Bonzini redhat.com> writes: > > > On 21/10/2015 12:17, Hebbal Yacine wrote: > > Thanks for the explanation, it's very clear. > > I tired that but I didn't succeed to send the ioctl from "run_on_cpu" > > function, I didn't find how to set the right CPUStat > > I've tried "current_cpu" >

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Paolo Bonzini
On 21/10/2015 00:57, Wanpeng Li wrote: >> kvm_sched_out and kvm_sched_in are part of KVM's preemption hooks. The >> hooks are registered only between vcpu_load and vcpu_put, therefore they >> know that the mutex is taken. The sequence will go like this: >> >> vcpu_load >>

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Yacine HEBBAL
Paolo Bonzini redhat.com> writes: > > > On 21/10/2015 00:57, Wanpeng Li wrote: > >> kvm_sched_out and kvm_sched_in are part of KVM's preemption hooks. The > >> hooks are registered only between vcpu_load and vcpu_put, therefore they > >> know that the mutex is taken. The sequence will go

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Paolo Bonzini
On 21/10/2015 12:17, Hebbal Yacine wrote: > Thanks for the explanation, it's very clear. > I tired that but I didn't succeed to send the ioctl from "run_on_cpu" > function, I didn't find how to set the right CPUStat > I've tried "current_cpu" Current_cpu is always NULL outside the VCPU thread.

Difference between vcpu_load and kvm_sched_in ?

2015-10-20 Thread Yacine
ock at all (logs here: http://pastebin.com/h5XNNMcb). So, what I want to know is: what is the difference between vcpu_load and kvm_sched_in ? both of this functions call kvm_arch_vcpu_loadbut the latter one does it without doing a mutex Is there a problem in using kvm_sched_in instead of vcpu_load

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-20 Thread Paolo Bonzini
). > > So, what I want to know is: what is the difference between vcpu_load and > kvm_sched_in ? both of this functions call kvm_arch_vcpu_loadbut the latter > one does it without doing a mutex kvm_sched_out and kvm_sched_in are part of KVM's preemption hooks. The hooks are registered onl

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-20 Thread Wanpeng Li
m/h5XNNMcb). So, what I want to know is: what is the difference between vcpu_load and kvm_sched_in ? both of this functions call kvm_arch_vcpu_loadbut the latter one does it without doing a mutex kvm_sched_out and kvm_sched_in are part of KVM's preemption hooks. The hooks are registered only between