Re: [PATCH V2] target: iscsi: simplify the connection closing mechanism

From
Mike Christie <michael.christie@oracle.com>
Date
2021-12-07 19:59:16
Also in
target-devel
Reply to
Maurizio Lombardi, 2021-11-11
On 11/11/21 7:37 AM, Maurizio Lombardi wrote:
When the connection reinstatement is performed, the target driver
executes a complex scheme of complete()/wait_for_completion() that is not
really needed.

Considering that:

1) The callers of iscsit_connection_reinstatement_rcfr() and
   iscsit_cause_connection_reinstatement() hold a reference
   to the conn structure.> > 2) iscsit_close_connection() will sleep when calling
   iscsit_check_conn_usage_count() until the conn structure's refcount
   reaches zero.

we can optimize the driver the following way:

* The threads that must sleep until the connection is closed
  will all wait for the "conn_wait_comp" completion,
  iscsit_close_connection() will then call complete_all() to wake them up.
  No need to have multiple completion structures.

* The conn_post_wait_comp completion is not necessary and can be removed
  because iscsit_close_connection() sleeps until all the other threads
  release the conn structure.
  (see the iscsit_check_conn_usage_count() function)

V2: do not set connection_reinstatement to 1 in iscsit_close_connection(),
    leave iscsit_cause_connection_reinstatement() deal with reentrancy.
What was the issue with setting it to 1?
Thread (3 messages) 3 messages, 2 authors, last reply 2021-12-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help