Re: [Qemu-devel] [PATCH 4/6] throttle: Add throttle group support

2015-03-25 Thread Stefan Hajnoczi
On Tue, Mar 24, 2015 at 06:48:37PM +0100, Alberto Garcia wrote: > On Tue, Mar 24, 2015 at 04:31:45PM +, Stefan Hajnoczi wrote: > > > > +/* get next bs round in round robin style */ > > > +token = throttle_group_next_bs(token); > > > +while (token != start && > > > + qemu

Re: [Qemu-devel] [PATCH 4/6] throttle: Add throttle group support

2015-03-24 Thread Alberto Garcia
On Tue, Mar 24, 2015 at 04:31:45PM +, Stefan Hajnoczi wrote: > > +/* get next bs round in round robin style */ > > +token = throttle_group_next_bs(token); > > +while (token != start && > > + qemu_co_queue_empty(&token->throttled_reqs[is_write])) { > > It's not safe to a

Re: [Qemu-devel] [PATCH 4/6] throttle: Add throttle group support

2015-03-24 Thread Stefan Hajnoczi
On Tue, Mar 10, 2015 at 05:30:48PM +0200, Alberto Garcia wrote: > +/* Return the next BlockDriverState in the round-robin sequence with > + * pending I/O requests. > + * > + * @bs:the current BlockDriverState > + * @is_write: the type of operation (read/write) > + * @ret: the next Bl

Re: [Qemu-devel] [PATCH 4/6] throttle: Add throttle group support

2015-03-24 Thread Stefan Hajnoczi
On Tue, Mar 10, 2015 at 05:30:48PM +0200, Alberto Garcia wrote: > @@ -179,10 +179,11 @@ static void bdrv_throttle_write_timer_cb(void *opaque) > } > > /* should be called before bdrv_set_io_limits if a limit is set */ > -void bdrv_io_limits_enable(BlockDriverState *bs) > +void bdrv_io_limits_en

[Qemu-devel] [PATCH 4/6] throttle: Add throttle group support

2015-03-12 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 computes if a wait must be done and arms the right timer. - If a wait must be done the token t