Commit aa2789e9 authored by GangCao's avatar GangCao Committed by Changpeng Liu
Browse files

QoS/Bdev: update the Byte rate limit timeslice control



Considering the I/O size is variant from small in byte to
large in megabyte, need to consider the compensation of less
allowed bytes in next timeslice if the current timeslice
sends more bytes down.

Change-Id: I885f0bb21001bd90879aa8622e2b34e3bf78cf6e
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/417829


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 1f2e8628
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1222,7 +1222,13 @@ spdk_bdev_channel_poll_qos(void *arg)

	/* Reset for next round of rate limiting */
	qos->io_submitted_this_timeslice = 0;

	/* More bytes sent in the last timeslice, allow less in this timeslice */
	if (qos->byte_submitted_this_timeslice > qos->max_byte_per_timeslice) {
		qos->byte_submitted_this_timeslice -= qos->max_byte_per_timeslice;
	} else {
		qos->byte_submitted_this_timeslice = 0;
	}

	_spdk_bdev_qos_io_submit(qos->ch);