scsi: core: Only re-run queue in scsi_end_request() if device queue is busy
authorMing Lei <ming.lei@redhat.com>
Thu, 10 Sep 2020 07:50:56 +0000 (15:50 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 16 Sep 2020 02:20:11 +0000 (22:20 -0400)
commited5dd6a67d5eac5fb8873697b55dc1699752a9f3
treef2b12578e83f2b256c0dbf532741ee1f41d110d3
parentf97e6e1eabbfed0ec3ccce7562df26a5b21d0d99
scsi: core: Only re-run queue in scsi_end_request() if device queue is busy

The request queue is currently run unconditionally in scsi_end_request() if
both target queue and host queue are ready.

Recently Long Li reported that cost of a queue run can be very heavy in
case of high queue depth. Improve this situation by only running the
request queue when this LUN is busy.

Link: https://lore.kernel.org/r/20200910075056.36509-1-ming.lei@redhat.com
Reported-by: Long Li <longli@microsoft.com>
Tested-by: Long Li <longli@microsoft.com>
Tested-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi_device.h