projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c772a9
)
Blk-iolatency: warn on negative inflight IO counter
author
Liu Bo
<
[email protected]
>
Fri, 25 Jan 2019 00:12:48 +0000
(08:12 +0800)
committer
Jens Axboe
<
[email protected]
>
Fri, 8 Feb 2019 19:42:27 +0000
(12:42 -0700)
This is to catch any unexpected negative value of inflight IO counter.
Signed-off-by: Liu Bo <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
block/blk-iolatency.c
patch
|
blob
|
history
diff --git
a/block/blk-iolatency.c
b/block/blk-iolatency.c
index 1893686a9c1f3b3fcbfdf1275193e5a34da6673c..2620baa1f6993db5e6706a36240ab4c6a2931038 100644
(file)
--- a/
block/blk-iolatency.c
+++ b/
block/blk-iolatency.c
@@
-592,6
+592,7
@@
static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio)
u64 now = ktime_to_ns(ktime_get());
bool issue_as_root = bio_issue_as_root_blkg(bio);
bool enabled = false;
+ int inflight = 0;
blkg = bio->bi_blkg;
if (!blkg || !bio_flagged(bio, BIO_TRACKED))
@@
-613,7
+614,8
@@
static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio)
}
rqw = &iolat->rq_wait;
- atomic_dec(&rqw->inflight);
+ inflight = atomic_dec_return(&rqw->inflight);
+ WARN_ON_ONCE(inflight < 0);
if (iolat->min_lat_nsec == 0)
goto next;
iolatency_record_time(iolat, &bio->bi_issue, now,