Skip to content

Commit

Permalink
block, bfq: reduce upper bound for inject limit to max_rq_in_driver+1
Browse files Browse the repository at this point in the history
Upon an increment attempt of the injection limit, the latter is
constrained not to become higher than twice the maximum number
max_rq_in_driver of I/O requests that have happened to be in service
in the drive. This high bound allows the injection limit to grow
beyond max_rq_in_driver, which may then cause max_rq_in_driver itself
to grow.

However, since the limit is incremented by only one unit at a time,
there is no need for such a high bound, and just max_rq_in_driver+1 is
enough.

Tested-by: Oleksandr Natalenko <[email protected]>
Signed-off-by: Paolo Valente <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Algodev-github authored and axboe committed Sep 18, 2019
1 parent 23ed570 commit c1e0a18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -5805,7 +5805,7 @@ static void bfq_update_inject_limit(struct bfq_data *bfqd,
bfqq->inject_limit--;
bfqq->decrease_time_jif = jiffies;
} else if (tot_time_ns < threshold &&
old_limit < bfqd->max_rq_in_driver<<1)
old_limit <= bfqd->max_rq_in_driver)
bfqq->inject_limit++;
}

Expand Down

0 comments on commit c1e0a18

Please sign in to comment.