Re: [Qemu-devel] [PATCH v7 1/5] cpu: Provide vcpu throttling interface

2015-09-09 Thread Paolo Bonzini
On 09/09/2015 13:01, Juan Quintela wrote: > Paolo Bonzini wrote: >> On 09/09/2015 12:41, Juan Quintela wrote: > +qemu_mutex_unlock_iothread(); > +atomic_set(&cpu->throttle_thread_scheduled, 0); > +g_usleep(sleeptime_ns / 1000); /* Convert ns to us for usleep call */ >

Re: [Qemu-devel] [PATCH v7 1/5] cpu: Provide vcpu throttling interface

2015-09-09 Thread Juan Quintela
Paolo Bonzini wrote: > On 09/09/2015 12:41, Juan Quintela wrote: >>> > +qemu_mutex_unlock_iothread(); >>> > +atomic_set(&cpu->throttle_thread_scheduled, 0); >>> > +g_usleep(sleeptime_ns / 1000); /* Convert ns to us for usleep call */ >>> > +qemu_mutex_lock_iothread(); >> >> Why is

Re: [Qemu-devel] [PATCH v7 1/5] cpu: Provide vcpu throttling interface

2015-09-09 Thread Juan Quintela
Paolo Bonzini wrote: > On 08/09/2015 19:12, Jason J. Herne wrote: >> Provide a method to throttle guest cpu execution. CPUState is augmented with >> timeout controls and throttle start/stop functions. To throttle the guest cpu >> the caller simply has to call the throttle set function and provide

Re: [Qemu-devel] [PATCH v7 1/5] cpu: Provide vcpu throttling interface

2015-09-09 Thread Paolo Bonzini
On 09/09/2015 12:41, Juan Quintela wrote: >> > +qemu_mutex_unlock_iothread(); >> > +atomic_set(&cpu->throttle_thread_scheduled, 0); >> > +g_usleep(sleeptime_ns / 1000); /* Convert ns to us for usleep call */ >> > +qemu_mutex_lock_iothread(); > > Why is this thread safe? > > qemu

Re: [Qemu-devel] [PATCH v7 1/5] cpu: Provide vcpu throttling interface

2015-09-09 Thread Juan Quintela
"Jason J. Herne" wrote: > Provide a method to throttle guest cpu execution. CPUState is augmented with > timeout controls and throttle start/stop functions. To throttle the guest cpu > the caller simply has to call the throttle set function and provide a > percentage > of throttle time. > > Signe

Re: [Qemu-devel] [PATCH v7 1/5] cpu: Provide vcpu throttling interface

2015-09-09 Thread Paolo Bonzini
On 08/09/2015 19:12, Jason J. Herne wrote: > Provide a method to throttle guest cpu execution. CPUState is augmented with > timeout controls and throttle start/stop functions. To throttle the guest cpu > the caller simply has to call the throttle set function and provide a > percentage > of thro

[Qemu-devel] [PATCH v7 1/5] cpu: Provide vcpu throttling interface

2015-09-08 Thread Jason J. Herne
Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle the guest cpu the caller simply has to call the throttle set function and provide a percentage of throttle time. Signed-off-by: Jason J. Herne Reviewed-by: