summaryrefslogtreecommitdiff
path: root/flow.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2013-05-17 21:52:08 +0200
committerJens Axboe <axboe@kernel.dk>2013-05-17 21:52:08 +0200
commitcb44aa1f72811770d50e1ba5da3d96f2beb51025 (patch)
tree149c023b5b2edcb6408e00bcbe3ff103262c3fc4 /flow.c
parent4d01ece69f7b4d7bd56210e0f839944a91c5679f (diff)
flow: quiesce pending IO before sleep
Similar potential latency problem as was fixed for thinktime in commit 002e7183 and for rated IO in commit c3a1b740. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/flow.c b/flow.c
index b7a2fb1..f9d868d 100644
--- a/flow.c
+++ b/flow.c
@@ -23,8 +23,11 @@ int flow_threshold_exceeded(struct thread_data *td)
sign = td->o.flow > 0 ? 1 : -1;
if (sign * flow->flow_counter > td->o.flow_watermark) {
- if (td->o.flow_sleep)
+ if (td->o.flow_sleep) {
+ io_u_quiesce(td);
usleep(td->o.flow_sleep);
+ }
+
return 1;
}