Skip to content

Commit

Permalink
deepin: only use BFQ as the elevator for single queue rotate devices
Browse files Browse the repository at this point in the history
Why: bfq elevator shows high bandwidth in read/write than other in hdd.[1]

Question:
It is correct time to get the flag?

If we can get the flag,so we can only use BFQ elevator for hdd.
or it is same as before.

Answer:
It is ok for:
use this macro:blk_queue_flag_set(QUEUE_FLAG_NONROT
for no rotate block device like ssd:
blk_queue_flag_set(QUEUE_FLAG_NONROT
device_add_disk->
elevator_init_mq->
elevator_get_default-> choose mq-deadline
for rotate device like hdd:
device_add_disk->
elevator_init_mq->
elevator_get_default-> choose bfq

Link:https://ieeexplore.ieee.org/document/7469567 [1]

Signed-off-by: Wentao Guan <[email protected]>
  • Loading branch information
opsiff committed Sep 16, 2024
1 parent 3f4d760 commit ad0a462
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ static struct elevator_type *elevator_get_default(struct request_queue *q)
!blk_mq_is_shared_tags(q->tag_set->flags))
return NULL;
#if defined(CONFIG_IOSCHED_BFQ)
return elevator_find_get(q, "bfq");
if (!blk_queue_nonrot(q))
return elevator_find_get(q, "bfq");
return elevator_find_get(q, "mq-deadline");
#else
return elevator_find_get(q, "mq-deadline");
#endif
Expand Down

0 comments on commit ad0a462

Please sign in to comment.