Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

blk-mq: apply normal plugging for HDD

Some HDD drive may expose multiple hardware queues, such as MegraRaid.
Let's apply the normal plugging for such devices because sequential IO
may benefit a lot from plug merging.

Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
3154df26 a12de1d4

+5 -1
+5 -1
block/blk-mq.c
··· 1992 1992 /* bypass scheduler for flush rq */ 1993 1993 blk_insert_flush(rq); 1994 1994 blk_mq_run_hw_queue(data.hctx, true); 1995 - } else if (plug && (q->nr_hw_queues == 1 || q->mq_ops->commit_rqs)) { 1995 + } else if (plug && (q->nr_hw_queues == 1 || q->mq_ops->commit_rqs || 1996 + !blk_queue_nonrot(q))) { 1996 1997 /* 1997 1998 * Use plugging if we have a ->commit_rqs() hook as well, as 1998 1999 * we know the driver uses bd->last in a smart fashion. 2000 + * 2001 + * Use normal plugging if this disk is slow HDD, as sequential 2002 + * IO may benefit a lot from plug merging. 1999 2003 */ 2000 2004 unsigned int request_count = plug->rq_count; 2001 2005 struct request *last = NULL;