scsi: ibmvfc: Set default timeout to avoid crash during migration
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 8/12 scsi: ibmvfc: Set default timeout to avoid crash during migration
From: Brian King <[email protected]>
[ Upstream commit 764907293edc1af7ac857389af9dc858944f53dc ]
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_insertNormally, 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.
--- drivers/scsi/ibmvscsi/ibmvfc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvfc.c +3 -1
@@ -2890,8 +2890,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 ; }
Signature · 1 line
2.27.0
PATCH 9/12 selftests/powerpc: Only test lwm/stmw on big endian
In reply to a message not in the archiveFrom: Michael Ellerman <[email protected]>
[ Upstream commit dd3a44c06f7b4f14e90065bf05d62c255b20005f ]
Newer binutils (>= 2.36) refuse to assemble lmw/stmw when building in little endian mode. That breaks compilation of our alignment handler test:
/tmp/cco4l14N.s: Assembler messages:
/tmp/cco4l14N.s:1440: Error: lmw' invalid when little-endian /tmp/cco4l14N.s:1814: Error: stmw' invalid when little-endian
make[2]: *** [../../lib.mk:139: /output/kselftest/powerpc/alignment/alignment_handler] Error 1
These tests do pass on little endian machines, as the kernel will still emulate those instructions even when running little endian (which is arguably a kernel bug).
But we don't really need to test that case, so ifdef those instructions out to get the alignment test building again.
--- .../testing/selftests/powerpc/alignment/alignment_handler.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/powerpc/alignment/alignment_handler.c +4 -1
@@ -384,7 +384,6 @@ int test_alignment_handler_integer(void)LOAD_DFORM_TEST (ldu);LOAD_XFORM_TEST (ldx);LOAD_XFORM_TEST (ldux); -LOAD_DFORM_TEST (lmw);STORE_DFORM_TEST (stb);STORE_XFORM_TEST (stbx);STORE_DFORM_TEST (stbu);
@@ -403,7 +402,11 @@ int test_alignment_handler_integer(void)STORE_XFORM_TEST (stdx);STORE_DFORM_TEST (stdu);STORE_XFORM_TEST (stdux); + +#ifdef __BIG_ENDIAN__ +LOAD_DFORM_TEST (lmw);STORE_DFORM_TEST (stmw); +#endif return rc; }
Signature · 1 line
2.27.0