The Wednesday 14 May 2014 à 16:22:44 (+0200), Stefan Hajnoczi wrote : > This series applies on top of my "dataplane: use QEMU block layer" series. > > Now that the dataplane code path is using the QEMU block layer we should make > I/O throttling limits safe to use. When the block_set_io_throttle monitor > command is executed, the BlockDriverState's AioContext must be acquired in > order to prevent race conditions with the IOThread that is processing requests > from the guest. > > The new block layer AioContext detach/attach mechanism needs to be extended to > move the throttling timer to a new AioContext. This makes throttling work > across bdrv_set_aio_context() calls. > > The result of this series is that I/O throttling works with dataplane and > limits may be changed at runtime using the monitor. > > Stefan Hajnoczi (3): > throttle: add throttle_detach/attach_aio_context() > throttle: add detach/attach test case > blockdev: acquire AioContext in block_set_io_throttle > > block.c | 7 +++++++ > blockdev.c | 6 ++++++ > include/qemu/throttle.h | 10 ++++++++++ > tests/test-throttle.c | 49 > ++++++++++++++++++++++++++++++++++++++++++++----- > util/throttle.c | 27 +++++++++++++++++++++++---- > 5 files changed, 90 insertions(+), 9 deletions(-) > > -- > 1.9.0 >
As a side note the throttling code does eat some CPU time. So if people starts using throttling with dataplane by setting 50k iops as a limit the timers callback will start to kill half a core. The solution could be to optionaly make the throttling resolution coarser. I have future plan to do this for SSD usage Best regards Benoît