mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block: drop duplicated slice extension code
The current slice is extended when an I/O request exceeds the limit. There is no need to extend the slice every time we check a request. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-By: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
ae29d6c64b
commit
e660fb8b3c
1 changed files with 1 additions and 4 deletions
5
block.c
5
block.c
|
@ -3867,10 +3867,7 @@ static bool bdrv_exceed_io_limits(BlockDriverState *bs, int nb_sectors,
|
|||
int bps_ret, iops_ret;
|
||||
|
||||
now = qemu_get_clock_ns(vm_clock);
|
||||
if ((bs->slice_start < now)
|
||||
&& (bs->slice_end > now)) {
|
||||
bs->slice_end = now + BLOCK_IO_SLICE_TIME;
|
||||
} else {
|
||||
if (now > bs->slice_end) {
|
||||
bs->slice_start = now;
|
||||
bs->slice_end = now + BLOCK_IO_SLICE_TIME;
|
||||
memset(&bs->slice_submitted, 0, sizeof(bs->slice_submitted));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue