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

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 18:33, Jason J. Herne wrote: > I've made all of the changes you have suggested except adding atomics. I'm > having > a bit of trouble figuring out what is needed here. Perhaps I should be using > atomic_read() to read throttle_percentage? If so, I don't undertand why. > Rather >

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

2015-07-02 Thread Jason J. Herne
On 07/01/2015 10:03 AM, Paolo Bonzini wrote: On 26/06/2015 20:07, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle the

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

2015-07-02 Thread Paolo Bonzini
On 02/07/2015 16:25, Jason J. Herne wrote: > Hi Paolo, > I like your suggestions. I'll switch to a static timer and create it in > cpu_ticks_init. > So no need for a timer_free anywhere then? Nope. :) Paolo

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

2015-07-02 Thread Jason J. Herne
On 07/01/2015 10:03 AM, Paolo Bonzini wrote: On 26/06/2015 20:07, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle the

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

2015-07-01 Thread Paolo Bonzini
On 26/06/2015 20:07, Dr. David Alan Gilbert wrote: > * Jason J. Herne (jjhe...@linux.vnet.ibm.com) 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 ca

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

2015-07-01 Thread Paolo Bonzini
On 25/06/2015 19:46, Jason J. Herne wrote: > +static void cpu_throttle_thread(void *opaque) > +{ > +long sleeptime_ms = (long)(throttle_ratio * CPU_THROTTLE_TIMESLICE); > + > +qemu_mutex_unlock_iothread(); > +g_usleep(sleeptime_ms * 1000); /* Convert ms to us for usleep call */ > +

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

2015-06-29 Thread Jason J. Herne
On 06/26/2015 03:02 PM, Jason J. Herne wrote: On 06/26/2015 02:07 PM, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle t

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

2015-06-29 Thread Dr. David Alan Gilbert
* Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: > On 06/26/2015 02:07 PM, Dr. David Alan Gilbert wrote: > >* Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: > >>Provide a method to throttle guest cpu execution. CPUState is augmented with > >>timeout controls and throttle start/stop function

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

2015-06-26 Thread Jason J. Herne
On 06/26/2015 02:07 PM, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) 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

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

2015-06-26 Thread Dr. David Alan Gilbert
* Jason J. Herne (jjhe...@linux.vnet.ibm.com) 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 >

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

2015-06-25 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: