scsi: core: move scsi_host_busy() out of host lock if it is for per-command
PATCH 1/1 scsi: core: move scsi_host_busy() out of host lock if it is for per-command
Commit 4373534a9850 ("scsi: core: Move scsi_host_busy() out of host lock for waking up EH handler") is for fixing hard lockup issue triggered by EH.
The core idea is to move scsi_host_busy() out of host lock if it is called for per-command. However, the patch is merged as wrong and doesn't move scsi_host_busy() out of host lock, so fix it.
--- drivers/scsi/scsi_error.c | 3 ++- drivers/scsi/scsi_lib.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/scsi_error.c +2 -1
@@ -282,11 +282,12 @@ static void scsi_eh_inc_host_failed(struct rcu_head *head) {struct scsi_cmnd *scmd =container_of (head,typeof (*scmd), rcu);struct Scsi_Host *shost = scmd->device->host; +unsigned int busy =scsi_host_busy (shost);unsigned long flags;spin_lock_irqsave (shost->host_lock, flags); shost->host_failed++; -scsi_eh_wakeup (shost,scsi_host_busy (shost)); +scsi_eh_wakeup (shost, busy);spin_unlock_irqrestore (shost->host_lock, flags); }
drivers/scsi/scsi_lib.c +3 -1
@@ -278,9 +278,11 @@ static void scsi_dec_host_busy(struct Scsi_Host *shost, struct scsi_cmnd *cmd)rcu_read_lock ();__clear_bit (SCMD_STATE_INFLIGHT , &cmd->state);if (unlikely (scsi_host_in_recovery (shost))) { +unsigned int busy =scsi_host_busy (shost); +spin_lock_irqsave (shost->host_lock, flags);if (shost->host_failed || shost->host_eh_scheduled) -scsi_eh_wakeup (shost,scsi_host_busy (shost)); +scsi_eh_wakeup (shost, busy);spin_unlock_irqrestore (shost->host_lock, flags); }rcu_read_unlock ();
Signature · 1 line
2.41.0
Quoted 5 lines · Ming Lei
Commit
4373534a9850("scsi: core: Movescsi_host_busy()out of host lock for waking up EH handler") is for fixing hard lockup issue triggered by EH.The core idea is to move
scsi_host_busy()out of host lock if it is called for per-command. However, the patch is merged as wrong and
^^^^^^^^^^^^^^^
I'm not sure what this means?
Quoted 1 line
doesn't move
scsi_host_busy()out of host lock, so fix it.
Anyway:
Martin K. Petersen
AppliedQuoted 8 lines · Ming Lei
Commit
4373534a9850("scsi: core: Movescsi_host_busy()out of host lock for waking up EH handler") is for fixing hard lockup issue triggered by EH.The core idea is to move
scsi_host_busy()out of host lock if it is called for per-command. However, the patch is merged as wrong and doesn't movescsi_host_busy()out of host lock, so fix it.[...]
Applied to 6.8/scsi-fixes, thanks!
[1/1] scsi: core: move scsi_host_busy() out of host lock if it is for per-command
https://git.kernel.org/mkp/scsi/c/4e6c90119907
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering