OSDN Git Service

net/smc: Limit SMC visits when handshake workqueue congested
authorD. Wythe <alibuda@linux.alibaba.com>
Thu, 10 Feb 2022 09:11:36 +0000 (17:11 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Feb 2022 11:14:58 +0000 (11:14 +0000)
commit48b6190a00425a1bebac9f7ae4b338a1e20f50f3
treed09c1a15ff613b007200252c92cd4d02e9473628
parent8270d9c21041470f58348248b9d9dcf3bf79592e
net/smc: Limit SMC visits when handshake workqueue congested

This patch intends to provide a mechanism to put constraint on SMC
connections visit according to the pressure of SMC handshake process.
At present, frequent visits will cause the incoming connections to be
backlogged in SMC handshake queue, raise the connections established
time. Which is quite unacceptable for those applications who base on
short lived connections.

There are two ways to implement this mechanism:

1. Put limitation after TCP established.
2. Put limitation before TCP established.

In the first way, we need to wait and receive CLC messages that the
client will potentially send, and then actively reply with a decline
message, in a sense, which is also a sort of SMC handshake, affect the
connections established time on its way.

In the second way, the only problem is that we need to inject SMC logic
into TCP when it is about to reply the incoming SYN, since we already do
that, it's seems not a problem anymore. And advantage is obvious, few
additional processes are required to complete the constraint.

This patch use the second way. After this patch, connections who beyond
constraint will not informed any SMC indication, and SMC will not be
involved in any of its subsequent processes.

Link: https://lore.kernel.org/all/1641301961-59331-1-git-send-email-alibuda@linux.alibaba.com/
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
net/ipv4/tcp_input.c
net/smc/af_smc.c