Skip to content

Commit

Permalink
cfq-iosched: fix the setting of IOPS mode on SSDs
Browse files Browse the repository at this point in the history
A previous commit wanted to make CFQ default to IOPS mode on
non-rotational storage, however it did so when the queue was
initialized and the non-rotational flag is only set later on
in the probe.

Add an elevator hook that gets called off the add_disk() path,
at that point we know that feature probing has finished, and
we can reliably check for the various flags that drivers can
set.

Fixes: 41c0126b ("block: Make CFQ default to IOPS mode on SSDs")
Tested-by: Romain Francoise <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Alex Naidis <[email protected]>
  • Loading branch information
axboe authored and mukul2259 committed Aug 29, 2020
1 parent 90f9545 commit f3e7e15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4455,7 +4455,7 @@ static int cfq_init_queue(struct request_queue *q, struct elevator_type *e)
cfqd->cfq_slice[1] = cfq_slice_sync;
cfqd->cfq_target_latency = cfq_target_latency;
cfqd->cfq_slice_async_rq = cfq_slice_async_rq;
cfqd->cfq_slice_idle = blk_queue_nonrot(q) ? 0 : cfq_slice_idle;
cfqd->cfq_slice_idle = cfq_slice_idle;
cfqd->cfq_group_idle = cfq_group_idle;
cfqd->cfq_latency = 1;
cfqd->hw_tag = -1;
Expand Down

0 comments on commit f3e7e15

Please sign in to comment.