All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Kai Shen <KaiShen@linux.alibaba.com>,
	kgraul@linux.ibm.com, wenjia@linux.ibm.com, jaka@linux.ibm.com,
	kuba@kernel.org, davem@davemloft.net, dsahern@kernel.org
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next] net/smc: introduce shadow sockets for fallback connections
Date: Wed, 22 Mar 2023 14:08:34 +0100	[thread overview]
Message-ID: <8f4bd9333117eda4c5ff324f92b969d9a6b57b65.camel@redhat.com> (raw)
In-Reply-To: <20230321071959.87786-1-KaiShen@linux.alibaba.com>

On Tue, 2023-03-21 at 07:19 +0000, Kai Shen wrote:
> SMC-R performs not so well on fallback situations right now,
> especially on short link server fallback occasions. We are planning
> to make SMC-R widely used and handling this fallback performance
> issue is really crucial to us. Here we introduce a shadow socket
> method to try to relief this problem.
> 
> Basicly, we use two more accept queues to hold incoming connections,
> one for fallback connections and the other for smc-r connections.
> We implement this method by using two more 'shadow' sockets and
> make the connection path of fallback connections almost the same as
> normal tcp connections.
> 
> Now the SMC-R accept path is like:
>   1. incoming connection
>   2. schedule work to smc sock alloc, tcp accept and push to smc
>      acceptq
>   3. wake up user to accept
> 
> When fallback happens on servers, the accepting path is the same
> which costs more than normal tcp accept path. In fallback
> situations, the step 2 above is not necessary and the smc sock is
> also not needed. So we use two more shadow sockets when one smc
> socket start listening. When new connection comes, we pop the req
> to the fallback socket acceptq or the non-fallback socket acceptq
> according to its syn_smc flag. As a result, when fallback happen we
> can graft the user socket with a normal tcp sock instead of a smc
> sock and get rid of the cost generated by step 2 and smc sock
> releasing.
> 
>                +-----> non-fallback socket acceptq
>                |
> incoming req --+
>                |
>                +-----> fallback socket acceptq
> 
> With the help of shadow socket, we gain similar performance as tcp
> connections on short link nginx server fallback occasions as what
> is illustrated below.

It looks like only the shadow sockets' receive queue is needed/used.

Have you considered instead adding 2 receive queues to smc_sock, and
implement a custom accept() variant fetching the accepted sockets from
there?

That will allow better encapsulating the changes into the smc code and
will avoid creating that 2 non-listening but almost listening sockets
which look quite strange.

Cheers,

Paolo


  reply	other threads:[~2023-03-22 13:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  7:19 [PATCH net-next] net/smc: introduce shadow sockets for fallback connections Kai Shen
2023-03-22 13:08 ` Paolo Abeni [this message]
2023-03-24  8:21   ` Kai
2023-03-22 17:09 ` Wenjia Zhang
2023-03-24  7:26   ` Kai
2023-03-29  9:41     ` Wenjia Zhang
2023-04-03 10:18       ` Kai

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=8f4bd9333117eda4c5ff324f92b969d9a6b57b65.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=KaiShen@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=jaka@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wenjia@linux.ibm.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.