From ed5dd6a67d5eac5fb8873697b55dc1699752a9f3 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Thu, 10 Sep 2020 15:50:56 +0800 Subject: 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 Tested-by: Long Li Tested-by: Kashyap Desai Reviewed-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Ewan D. Milne Reviewed-by: John Garry Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen --- include/scsi/scsi_device.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index bc5909033d13..1a5c9a3df6d6 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -109,6 +109,7 @@ struct scsi_device { atomic_t device_busy; /* commands actually active on LLDD */ atomic_t device_blocked; /* Device returned QUEUE_FULL. */ + atomic_t restarts; spinlock_t list_lock; struct list_head starved_entry; unsigned short queue_depth; /* How deep of a queue we want */ -- cgit v1.2.3-70-g09d2