netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "D. Wythe" <alibuda@linux.alibaba.com>
To: kgraul@linux.ibm.com
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org,
	"D. Wythe" <alibuda@linux.alibaba.com>
Subject: [PATCH net-next v5 0/5] net/smc: Optimizing performance in short-lived scenarios
Date: Tue,  8 Feb 2022 20:53:08 +0800	[thread overview]
Message-ID: <cover.1644323503.git.alibuda@linux.alibaba.com> (raw)

From: "D. Wythe" <alibuda@linux.alibaba.com>

This patch set aims to optimizing performance of SMC in short-lived
links scenarios, which is quite unsatisfactory right now.

In our benchmark, we test it with follow scripts:

./wrk -c 10000 -t 4 -H 'Connection: Close' -d 20 http://smc-server

Current performance figures like that:

Running 20s test @ http://11.213.45.6
  4 threads and 10000 connections
  4956 requests in 20.06s, 3.24MB read
  Socket errors: connect 0, read 0, write 672, timeout 0
Requests/sec:    247.07
Transfer/sec:    165.28KB

There are many reasons for this phenomenon, this patch set doesn't
solve it all though, but it can be well alleviated with it in.

Patch 1/5  (Make smc_tcp_listen_work() independent) :

Separate smc_tcp_listen_work() from smc_listen_work(), make them
independent of each other, the busy SMC handshake can not affect new TCP
connections visit any more. Avoid discarding a large number of TCP
connections after being overstock, which is undoubtedly raise the
connection establishment time.

Patch 2/5 (Limits SMC backlog connections):

Since patch 1 has separated smc_tcp_listen_work() from
smc_listen_work(), an unrestricted TCP accept have come into being. This
patch try to put a limit on SMC backlog connections refers to
implementation of TCP.

Patch 3/5 (Fallback when SMC handshake workqueue congested):

Considering the complexity of SMC handshake right now, in short-lived
links scenarios, this may not be the main scenario of SMC though, it's
performance is still quite poor. This Patch try to provide auto fallback
case when SMC handshake workqueue congested, which is the sign of SMC
handshake stacking in our opinion.

Patch 4/5 (Dynamic control SMC auto fallback by socket options)

This patch allow applications dynamically control the ability of SMC
auto fallback. Since SMC don't support set SMC socket option before,
this patch also have to support SMC's owns socket options.

Patch 5/5 (Add global configure for auto fallback by netlink)

This patch provides a way to get benefit of auto fallback without
modifying any code for applications, which is quite useful for most
existing applications.

After this patch set, performance figures like that:

Running 20s test @ http://11.213.45.6
  4 threads and 10000 connections
  693253 requests in 20.10s, 452.88MB read
Requests/sec:  34488.13
Transfer/sec:     22.53MB

That's a quite well performance improvement, about to 6 to 7 times in my
environment.
---
changelog:
v2 -> v1:
- fix compile warning
- fix invalid dependencies in kconfig
v3 -> v2:
- correct spelling mistakes
- fix useless variable declare
v4 -> v3
- make smc_tcp_ls_wq be static
v5 -> v4
- add dynamic control for SMC auto fallback by socket options
- add global configure for SMC auto fallback through netlink
---
D. Wythe (5):
  net/smc: Make smc_tcp_listen_work() independent
  net/smc: Limits backlog connections
  net/smc: Fallback when handshake workqueue congested
  net/smc: Dynamic control auto fallback by socket options
  net/smc: Add global configure for auto fallback by netlink

 include/linux/socket.h   |   1 +
 include/linux/tcp.h      |   1 +
 include/uapi/linux/smc.h |   7 +++
 net/ipv4/tcp_input.c     |   3 +-
 net/smc/af_smc.c         | 158 ++++++++++++++++++++++++++++++++++++++++++++++-
 net/smc/smc.h            |  12 ++++
 net/smc/smc_core.c       |   2 +
 net/smc/smc_netlink.c    |  10 +++
 8 files changed, 191 insertions(+), 3 deletions(-)

-- 
1.8.3.1


             reply	other threads:[~2022-02-08 13:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 12:53 D. Wythe [this message]
2022-02-08 12:53 ` [PATCH net-next v5 1/5] net/smc: Make smc_tcp_listen_work() independent D. Wythe
2022-02-08 17:06   ` Karsten Graul
2022-02-09  6:24     ` D. Wythe
2022-02-08 12:53 ` [PATCH net-next v5 2/5] net/smc: Limit backlog connections D. Wythe
2022-02-08 17:13   ` Karsten Graul
2022-02-09  7:11     ` D. Wythe
2022-02-09  7:56       ` Karsten Graul
2022-02-08 12:53 ` [PATCH net-next v5 3/5] net/smc: Fallback when handshake workqueue congested D. Wythe
2022-02-08 12:53 ` [PATCH net-next v5 4/5] net/smc: Dynamic control auto fallback by socket options D. Wythe
2022-02-08 17:08   ` Karsten Graul
2022-02-09  6:41     ` D. Wythe
2022-02-09  7:59       ` Karsten Graul
2022-02-09  9:01         ` D. Wythe
2022-02-08 12:53 ` [PATCH net-next v5 5/5] net/smc: Add global configure for auto fallback by netlink D. Wythe
2022-02-09  9:16   ` Tony Lu
2022-02-09  9:53     ` D. Wythe
2022-02-09 11:37       ` Tony Lu
2022-02-09  9:33   ` Tony Lu
2022-02-09  9:41     ` D. Wythe
2022-02-09  9:54       ` Tony Lu
2022-02-09 10:56         ` D. Wythe
2022-02-08 17:04 ` [PATCH net-next v5 0/5] net/smc: Optimizing performance in short-lived scenarios Karsten Graul

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=cover.1644323503.git.alibuda@linux.alibaba.com \
    --to=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).