]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
blk-mq: only attempt to merge bio if there is rq in sw queue
authorMing Lei <ming.lei@redhat.com>
Mon, 2 Jul 2018 09:35:59 +0000 (17:35 +0800)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:49:27 +0000 (19:49 -0600)
commit6b54778562a27070673ad8bb9e011c89d9f1a849
treeaf62d734ad77bdf0b97852ed3a3c8f31240108af
parentb6a8f6ebd502ca43ff55af6297f9308b2e210607
blk-mq: only attempt to merge bio if there is rq in sw queue

BugLink: https://bugs.launchpad.net/bugs/1836117
[ Upstream commit b04f50ab8a74129b3041a2836c33c916be3c6667 ]

Only attempt to merge bio iff the ctx->rq_list isn't empty, because:

1) for high-performance SSD, most of times dispatch may succeed, then
there may be nothing left in ctx->rq_list, so don't try to merge over
sw queue if it is empty, then we can save one acquiring of ctx->lock

2) we can't expect good merge performance on per-cpu sw queue, and missing
one merge on sw queue won't be a big deal since tasks can be scheduled from
one CPU to another.

Cc: Laurence Oberman <loberman@redhat.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Tested-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reported-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
block/blk-mq-sched.c