Skip to contentSkip to conversation

blk-iolatency: don't change the latency window

PATCH In review Josef Bacik 2 participants 3 messages Jul 16, 2018

Subsystems (2)
lore
Share & tools
lore

Josef Bacik

author maintainer
#0 lore raw

PATCH 1/2 blk-iolatency: don't change the latency window

From: Josef Bacik <[email protected]>

Early versions of these patches had us waiting for seconds at a time during submission, so we had to adjust the timing window we monitored for latency. Now we don't do things like that so this is unnecessary code.

---
 block/blk-iolatency.c | 10 ----------
 1 file changed, 10 deletions(-)
block/blk-iolatency.c +0 -10
index b59e5451680b..893f888eebb1 100644
@@ -468,16 +468,6 @@ static void iolatency_check_latencies(struct iolatency_grp *iolat, u64 now)
 	}
 	preempt_enable();
 
-	/*
-	 * Our average exceeded our window, scale up our window so we are more
-	 * accurate, but not more than the global timer.
-	 */
-	if (stat.mean > iolat->cur_win_nsec) {
-		iolat->cur_win_nsec <<= 1;
-		iolat->cur_win_nsec =
-			max_t(u64, iolat->cur_win_nsec, NSEC_PER_SEC);
-	}
-
 	parent = blkg_to_lat(blkg->parent);
 	if (!parent)
 		return;
Signature · 1 line
2.14.3
author maintainer
#1 lore raw

PATCH 2/2 blk-iolatency: truncate our current time

From: Josef Bacik <[email protected]>

In our longer tests we noticed that some boxes would degrade to the point of uselessness. This is because we truncate the current time when saving it in our bio, but I was using the raw current time to subtract from. So once the box had been up a certain amount of time it would appear as if our IO's were taking several years to complete. Fix this by truncating the current time so it matches the issue time. Verified this worked by running with this patch for a week on our test tier.

---
 block/blk-iolatency.c | 6 ++++++
 1 file changed, 6 insertions(+)
block/blk-iolatency.c +6 -0
index 893f888eebb1..bb59b2929e0d 100644
@@ -425,6 +425,12 @@ static void iolatency_record_time(struct iolatency_grp *iolat,
 	u64 start = bio_issue_time(issue);
 	u64 req_time;
 
+	/*
+	 * Have to do this so we are truncated to the correct time that our
+	 * issue is truncated to.
+	 */
+	now = __bio_issue_time(now);
+
 	if (now <= start)
 		return;
 
Signature · 1 line
2.14.3
maintainer
#2 lore raw
In reply to Josef Bacik
Quoted 6 lines · Josef Bacik

From: Josef Bacik <[email protected]>

Early versions of these patches had us waiting for seconds at a time during submission, so we had to adjust the timing window we monitored for latency. Now we don't do things like that so this is unnecessary code.

Applied 1-2 for 4.19.

Signature · 1 line
Jens Axboe