diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 2102744d39637554bb858fcc23c4fd2e2c05500a..2d89cd8560281658ef172cdf8a98e4f9ebecd75d 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -559,7 +559,7 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) struct rq_wait *rqw; struct iolatency_grp *iolat; u64 window_start; - u64 now = ktime_to_ns(ktime_get()); + u64 now; bool issue_as_root = bio_issue_as_root_blkg(bio); bool enabled = false; int inflight = 0; @@ -576,6 +576,7 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) if (!enabled) return; + now = ktime_to_ns(ktime_get()); while (blkg && blkg->parent) { iolat = blkg_to_lat(blkg); if (!iolat) {