Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-05 Thread Stefan Hajnoczi
On Wed, Mar 04, 2015 at 05:16:51PM +0100, Alberto Garcia wrote: On Wed, Mar 04, 2015 at 10:04:27AM -0600, Stefan Hajnoczi wrote: This pattern suggests throttle_timer_fired() should acquire the lock internally instead. The idea is that the ThrottleState code itself doesn't know

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-04 Thread Stefan Hajnoczi
On Wed, Mar 04, 2015 at 02:53:42PM +0100, Alberto Garcia wrote: On Tue, Mar 03, 2015 at 03:00:06PM -0600, Stefan Hajnoczi wrote: +throttle_group_lock(bs-throttle_state); +bdrv_throttle_group_remove(bs); +throttle_group_unlock(bs-throttle_state); + +

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-04 Thread Alberto Garcia
On Wed, Mar 04, 2015 at 10:04:27AM -0600, Stefan Hajnoczi wrote: This pattern suggests throttle_timer_fired() should acquire the lock internally instead. The idea is that the ThrottleState code itself doesn't know anything about locks or groups. As I understood it BenoƮt designed

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-04 Thread Alberto Garcia
On Tue, Mar 03, 2015 at 03:00:06PM -0600, Stefan Hajnoczi wrote: +throttle_group_lock(bs-throttle_state); +bdrv_throttle_group_remove(bs); +throttle_group_unlock(bs-throttle_state); + +throttle_group_unref(bs-throttle_state); +bs-throttle_state = NULL; +

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-03 Thread Stefan Hajnoczi
On Fri, Feb 13, 2015 at 06:06:15PM +0200, Alberto Garcia wrote: The throttle group support use a cooperative round robin scheduling algorithm. The principles of the algorithm are simple: - Each BDS of the group is used as a token in a circular way. - The active BDS compute if a wait must be

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-02-24 Thread Eric Blake
On 02/24/2015 09:45 AM, Eric Blake wrote: On 02/13/2015 09:06 AM, Alberto Garcia wrote: The throttle group support use a cooperative round robin scheduling algorithm. qapi/block-core.json | 5 +- qemu-options.hx | 1 + qmp-commands.hx | 3 +- Just a qapi

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-02-24 Thread Eric Blake
On 02/13/2015 09:06 AM, Alberto Garcia wrote: The throttle group support use a cooperative round robin scheduling algorithm. The principles of the algorithm are simple: - Each BDS of the group is used as a token in a circular way. - The active BDS compute if a wait must be done and arm the

[Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-02-13 Thread Alberto Garcia
The throttle group support use a cooperative round robin scheduling algorithm. The principles of the algorithm are simple: - Each BDS of the group is used as a token in a circular way. - The active BDS compute if a wait must be done and arm the right timer. - If a wait must be done the token