Skip to content

net/smc: Optimizing performance in short-lived scenarios

D. Wythe linux-rdma linux-s390 netdev 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest5 patches 3 repliesIn review
  2. v65 patches 7 repliesSuperseded
  3. v55 patches 17 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v43 patches4 repliesSuperseded
v33 patches0 repliesSuperseded
v23 patches10 repliesSuperseded
v13 patches4 repliesSuperseded

Changes in v7 from the cover letter

- fix wording and the naming issues, rename 'auto fallback' to handshake limitation.
---

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net/smc: Make smc_tcp_listen_work() independentnet/smc/af_smc.c+11 -20 replies
2/5net/smc: Limit backlog connectionsnet/smc/af_smc.c net/smc/smc.h+50 -10 replies
3/5net/smc: Limit SMC visits when handshake workqueue congestedinclude/linux/tcp.h net/ipv4/tcp_input.c net/smc/af_smc.c+20 -10 replies
4/5net/smc: Dynamic control handshake limitation by socket optionsinclude/linux/socket.h include/uapi/linux/smc.h net/smc/af_smc.c +1 more+74 -10 replies
5/5net/smc: Add global configure for handshake limitation by netlinkinclude/net/netns/smc.h include/uapi/linux/smc.h net/smc/af_smc.c +3 more+79 -01 reply

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKarsten GraulTony Lu
SeriesR-b
1/5
2/5
3/5
4/5
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH net-next v7 0/5] net/smc: Optimizing performance in short-lived scenarios

From: "D. Wythe" <[email protected]>

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 (Limit 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 (Limit SMC visits when 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 constraint on SMC handshake when handshake workqueue congested, which is the sign of SMC handshake stacking in our opinion.

Patch 4/5 (Dynamic control handshake limitation by socket options)

This patch allow applications dynamically control the ability of SMC handshake limitation. 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 handshake limitation by netlink)

This patch provides a way to get benefit of handshake limitation 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:
v1 -> v2:
- fix compile warning
- fix invalid dependencies in kconfig
v2 -> v3:
- correct spelling mistakes
- fix useless variable declare
v3 -> v4
- make smc_tcp_ls_wq be static
v4 -> v5
- add dynamic control for SMC auto fallback by socket options
- add global configure for SMC auto fallback through netlink v5 -> v6
- move auto fallback to net namespace scope
- remove auto fallback attribute in SMC_GEN_SYS_INFO
- add independent attributes for auto fallback
v6 -> v7
- fix wording and the naming issues, rename 'auto fallback' to handshake limitation.
---

D. Wythe (5):
net/smc: Make smc_tcp_listen_work() independent net/smc: Limit backlog connections
net/smc: Limit SMC visits when handshake workqueue congested net/smc: Dynamic control handshake limitation by socket options net/smc: Add global configure for handshake limitation by netlink

 include/linux/socket.h   |   1 +
 include/linux/tcp.h      |   1 +
 include/net/netns/smc.h  |   2 +
 include/uapi/linux/smc.h |  15 ++++
 net/ipv4/tcp_input.c     |   3 +-
 net/smc/af_smc.c         | 184 ++++++++++++++++++++++++++++++++++++++++++++++-
 net/smc/smc.h            |  13 +++-
 net/smc/smc_netlink.c    |  15 ++++
 net/smc/smc_pnet.c       |   3 +
 9 files changed, 233 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.3.1