qla2xxx: fix session free stall by using scst_unregister_session wait=0#347
Merged
lnocturno merged 1 commit intoSCST-project:masterfrom Mar 2, 2026
Merged
Conversation
Calling scst_unregister_session(wait=1) from qlt_free_session_done blocks the qla2xxx_wq worker until session teardown completes, but teardown requires the TM thread to process SCST_UNREG_SESS_TM while the TM thread is blocked on scst_mutex held by concurrent session teardown in the global management thread. Under load this stall exceeds the hung-task timeout. Switch to wait=0 and wait on fcport->unreg_done instead, matching the pattern in iscsi-scst.
Contributor
|
Hi Brian, Thank you for the patch! Gleb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling
scst_unregister_session(wait=1)fromqlt_free_session_doneblocks theqla2xxx_wqworker until session teardown completes, but teardown requires the TM thread to processSCST_UNREG_SESS_TMwhile the TM thread is blocked onscst_mutexheld by concurrent session teardown (scst_sess_free_tgt_devs -> synchronize_rcu()) in the global management thread.Under load this stall exceeds the hung-task timeout. Switch to
wait=0and wait onfcport->unreg_doneinstead, matching the pattern in iscsi-scst.sqa_free_session_done()is called fromscst_free_session()between its twoscst_mutexwindows, so the completion is signalled without holding the lock.(IMO, the declaration of the completion and setting of
fcport->unreg_donehints that this was always the intent.)