All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <mchristi@redhat.com>
To: xiubli@redhat.com, josef@toxicpanda.com, axboe@kernel.dk
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH] nbd: remove the duplicated code
Date: Tue, 10 Sep 2019 10:56:52 -0500	[thread overview]
Message-ID: <5D77C7C4.9000306@redhat.com> (raw)
In-Reply-To: <20190910063608.10081-1-xiubli@redhat.com>

On 09/10/2019 01:36 AM, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> The followed code will do the same check, and this part is redandant.
> 
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  drivers/block/nbd.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index 478aa86fc1f2..8c10ab51a086 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -1046,9 +1046,6 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg)
>  	for (i = 0; i < config->num_connections; i++) {
>  		struct nbd_sock *nsock = config->socks[i];
>  
> -		if (!nsock->dead)
> -			continue;
> -

Was this check to used to speed up reconnects? For example, if a send
was stuck waiting on socket memory to free up in the network layer, then
the above check would allow us to skip past those sockets without having
to wait on the socket that was trying to send.



>  		mutex_lock(&nsock->tx_lock);
>  		if (!nsock->dead) {
>  			mutex_unlock(&nsock->tx_lock);
> 


  reply	other threads:[~2019-09-10 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10  6:36 [PATCH] nbd: remove the duplicated code xiubli
2019-09-10 15:56 ` Mike Christie [this message]
2019-09-10 23:58   ` Xiubo Li

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=5D77C7C4.9000306@redhat.com \
    --to=mchristi@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=xiubli@redhat.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.