All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@kernel.org>
To: Tom Talpey <tom@talpey.com>
Cc: linux-cifs@vger.kernel.org, smfrench@gmail.com,
	senozhatsky@chromium.org, atteh.mailbox@gmail.com,
	Hyunchul Lee <hyc.lee@gmail.com>
Subject: Re: [PATCH] ksmbd: call ib_drain_qp when disconnected
Date: Mon, 3 Oct 2022 23:31:46 +0900	[thread overview]
Message-ID: <CAKYAXd-OVVSkCnMYxTrS06NA5+=dK8D7PHeCLbqxQL6MmJR4qg@mail.gmail.com> (raw)
In-Reply-To: <7e06ff88-baa5-c2c1-9184-2cb48d6182a5@talpey.com>

2022-10-03 3:11 GMT+09:00, Tom Talpey <tom@talpey.com>:
> On 10/1/2022 11:01 PM, Namjae Jeon wrote:
>> When disconnected, call ib_drain_qp to cancel all pending work requests
>> and prevent ksmbd_conn_handler_loop from waiting for a long time
>> for those work requests to compelete.
>>
>> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
>> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
>> ---
>>   fs/ksmbd/transport_rdma.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c
>> index 0315bca3d53b..096eda9ef873 100644
>> --- a/fs/ksmbd/transport_rdma.c
>> +++ b/fs/ksmbd/transport_rdma.c
>> @@ -1527,6 +1527,8 @@ static int smb_direct_cm_handler(struct rdma_cm_id
>> *cm_id,
>>   	}
>>   	case RDMA_CM_EVENT_DEVICE_REMOVAL:
>>   	case RDMA_CM_EVENT_DISCONNECTED: {
>> +		ib_drain_qp(t->qp);
>> +
>>   		t->status = SMB_DIRECT_CS_DISCONNECTED;
>>   		wake_up_interruptible(&t->wait_status);
>>   		wake_up_interruptible(&t->wait_reassembly_queue);
>
> Because we're now flushing the cancelled work requests, don't
> we need to also wake up &t->wait_send_pending, to abort any
> waiters on the send wq?
Could you please elaborate more how it could be a problem ?
send_pending is decreased and wake_up &t->wait_send_pending if it is
zero in send_done().

>
> Tom.
>

  reply	other threads:[~2022-10-03 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02  3:01 [PATCH] ksmbd: call ib_drain_qp when disconnected Namjae Jeon
2022-10-02 18:11 ` Tom Talpey
2022-10-03 14:31   ` Namjae Jeon [this message]
2022-10-03 15:48     ` Tom Talpey

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='CAKYAXd-OVVSkCnMYxTrS06NA5+=dK8D7PHeCLbqxQL6MmJR4qg@mail.gmail.com' \
    --to=linkinjeon@kernel.org \
    --cc=atteh.mailbox@gmail.com \
    --cc=hyc.lee@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.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.