From: Brian King <brking@linux.vnet.ibm.com>
To: tyreld@linux.ibm.com
Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
James.Bottomley@HansenPartnership.com,
Brian King <brking@linux.vnet.ibm.com>
Subject: [PATCH] ibmvfc: Set default timeout to avoid crash during migration
Date: Tue, 12 Jan 2021 09:06:38 -0600 [thread overview]
Message-ID: <1610463998-19791-1-git-send-email-brking@linux.vnet.ibm.com> (raw)
While testing live partition mobility, we have observed occasional
crashes of the Linux partition. What we've seen is that during
the live migration, for specific configurations with large amounts
of memory, slow network links, and workloads that are changing
memory a lot, the partition can end up being suspended for 30 seconds
or longer. This resulted in the following scenario:
CPU 0 CPU 1
------------------------------- ----------------------------------
scsi_queue_rq migration_store
-> blk_mq_start_request -> rtas_ibm_suspend_me
-> blk_add_timer -> on_each_cpu(rtas_percpu_suspend_me
_______________________________________V
|
V
-> IPI from CPU 1
-> rtas_percpu_suspend_me
-> __rtas_suspend_last_cpu
-- Linux partition suspended for > 30 seconds --
-> for_each_online_cpu(cpu)
plpar_hcall_norets(H_PROD
-> scsi_dispatch_cmd
-> scsi_times_out
-> scsi_abort_command
-> queue_delayed_work
-> ibmvfc_queuecommand_lck
-> ibmvfc_send_event
-> ibmvfc_send_crq
- returns H_CLOSED
<- returns SCSI_MLQUEUE_HOST_BUSY
-> __blk_mq_requeue_request
-> scmd_eh_abort_handler
-> scsi_try_to_abort_cmd
- returns SUCCESS
-> scsi_queue_insert
Normally, the SCMD_STATE_COMPLETE bit would protect against the
command completion and the timeout, but that doesn't work here,
since we don't check that at all in the SCSI_MLQUEUE_HOST_BUSY
path.
In this case we end up calling scsi_queue_insert on a request
that has already been queued, or possibly even freed, and
we crash.
The patch below simply increases the default I/O timeout to avoid
this race condition. This is also the timeout value that nearly
all IBM SAN storage recommends setting as the default value.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
drivers/scsi/ibmvscsi/ibmvfc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 42e4d35..79badaa 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3007,8 +3007,10 @@ static int ibmvfc_slave_configure(struct scsi_device *sdev)
unsigned long flags = 0;
spin_lock_irqsave(shost->host_lock, flags);
- if (sdev->type == TYPE_DISK)
+ if (sdev->type == TYPE_DISK) {
sdev->allow_restart = 1;
+ blk_queue_rq_timeout(sdev->request_queue, 120 * HZ);
+ }
spin_unlock_irqrestore(shost->host_lock, flags);
return 0;
}
--
1.8.3.1
next reply other threads:[~2021-01-12 15:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 15:06 Brian King [this message]
2021-01-15 4:08 ` [PATCH] ibmvfc: Set default timeout to avoid crash during migration Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1610463998-19791-1-git-send-email-brking@linux.vnet.ibm.com \
--to=brking@linux.vnet.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tyreld@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.