block: avoid setting wbt_lat_usec to current value
diff mbox series

Message ID 1549879834-24837-1-git-send-email-zakharov.a.g@yandex.ru
State New
Headers show
Series
  • block: avoid setting wbt_lat_usec to current value
Related show

Commit Message

Aleksei Zakharov Feb. 11, 2019, 10:10 a.m. UTC
There's no reason to set wbt min lat and freeze request queue
if current value is the same.

Signed-off-by: Aleksei Zakharov <zakharov.a.g@yandex.ru>
---
 block/blk-sysfs.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Johannes Thumshirn Feb. 11, 2019, 10:31 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Jens Axboe Feb. 11, 2019, 3:20 p.m. UTC | #2
On 2/11/19 3:10 AM, Aleksei Zakharov wrote:
> There's no reason to set wbt min lat and freeze request queue
> if current value is the same.

Applied, thanks.

Patch
diff mbox series

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 590d1ef..d0df883 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -468,6 +468,9 @@  static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page,
 	else if (val >= 0)
 		val *= 1000ULL;
 
+	if (wbt_get_min_lat(q) == val)
+		return count;
+
 	/*
 	 * Ensure that the queue is idled, in case the latency update
 	 * ends up either enabling or disabling wbt completely. We can't