Skip to content

Commit

Permalink
block: avoid setting nr_requests to current value
Browse files Browse the repository at this point in the history
There's no reason to freeze queue and set nr_requests value
if current value is the same.

Signed-off-by: Aleksei Zakharov <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
AlexZzz authored and axboe committed Feb 8, 2019
1 parent f25191b commit e5fa814
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -3089,6 +3089,9 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
if (!set)
return -EINVAL;

if (q->nr_requests == nr)
return 0;

blk_mq_freeze_queue(q);
blk_mq_quiesce_queue(q);

Expand Down

0 comments on commit e5fa814

Please sign in to comment.