mbox series

[net-next,v3,0/2] net/smc: introduce ringbufs usage statistics

Message ID 20240814130827.73321-1-guwen@linux.alibaba.com (mailing list archive)
Headers show
Series net/smc: introduce ringbufs usage statistics | expand

Message

Wen Gu Aug. 14, 2024, 1:08 p.m. UTC
Currently, we have histograms that show the sizes of ringbufs that ever
used by SMC connections. However, they are always incremental and since
SMC allows the reuse of ringbufs, we cannot know the actual amount of
ringbufs being allocated or actively used.

So this patch set introduces statistics for the amount of ringbufs that
actually allocated by link group and actively used by connections of a
certain net namespace, so that we can react based on these memory usage
information, e.g. active fallback to TCP.

With appropriate adaptations of smc-tools, we can obtain these ringbufs
usage information:

$ smcr -d linkgroup
LG-ID    : 00000500
LG-Role  : SERV
LG-Type  : ASYML
VLAN     : 0
PNET-ID  :
Version  : 1
Conns    : 0
Sndbuf   : 12910592 B    <-
RMB      : 12910592 B    <-

or

$ smcr -d stats
[...]
RX Stats
  Data transmitted (Bytes)      869225943 (869.2M)
  Total requests                 18494479
  Buffer usage  (Bytes)          12910592 (12.31M)  <-
  [...]

TX Stats
  Data transmitted (Bytes)    12760884405 (12.76G)
  Total requests                 36988338
  Buffer usage  (Bytes)          12910592 (12.31M)  <-
  [...]
[...]


Change log:
v3->v2
- use new helper nla_put_uint() instead of nla_put_u64_64bit().

v2->v1
https://lore.kernel.org/r/20240807075939.57882-1-guwen@linux.alibaba.com/
- remove inline keyword in .c files.
- use local variable in macros to avoid potential side effects.

v1
https://lore.kernel.org/r/20240805090551.80786-1-guwen@linux.alibaba.com/

Wen Gu (2):
  net/smc: introduce statistics for allocated ringbufs of link group
  net/smc: introduce statistics for ringbufs usage of net namespace

 include/uapi/linux/smc.h |  6 ++++
 net/smc/smc_core.c       | 68 +++++++++++++++++++++++++++++++++-------
 net/smc/smc_core.h       |  2 ++
 net/smc/smc_stats.c      |  6 ++++
 net/smc/smc_stats.h      | 28 +++++++++++------
 5 files changed, 90 insertions(+), 20 deletions(-)

Comments

Wen Gu Aug. 19, 2024, 9:43 a.m. UTC | #1
On 2024/8/14 21:08, Wen Gu wrote:
> Currently, we have histograms that show the sizes of ringbufs that ever
> used by SMC connections. However, they are always incremental and since
> SMC allows the reuse of ringbufs, we cannot know the actual amount of
> ringbufs being allocated or actively used.
> 
> So this patch set introduces statistics for the amount of ringbufs that
> actually allocated by link group and actively used by connections of a
> certain net namespace, so that we can react based on these memory usage
> information, e.g. active fallback to TCP.
> 
> With appropriate adaptations of smc-tools, we can obtain these ringbufs
> usage information:
> 
> $ smcr -d linkgroup
> LG-ID    : 00000500
> LG-Role  : SERV
> LG-Type  : ASYML
> VLAN     : 0
> PNET-ID  :
> Version  : 1
> Conns    : 0
> Sndbuf   : 12910592 B    <-
> RMB      : 12910592 B    <-
> 
> or
> 
> $ smcr -d stats
> [...]
> RX Stats
>    Data transmitted (Bytes)      869225943 (869.2M)
>    Total requests                 18494479
>    Buffer usage  (Bytes)          12910592 (12.31M)  <-
>    [...]
> 
> TX Stats
>    Data transmitted (Bytes)    12760884405 (12.76G)
>    Total requests                 36988338
>    Buffer usage  (Bytes)          12910592 (12.31M)  <-
>    [...]
> [...]
> 

FYI, The corresponding smc-tools modification has been submitted.

https://github.com/ibm-s390-linux/smc-tools/pull/11

Thanks!
patchwork-bot+netdevbpf@kernel.org Aug. 20, 2024, 10 a.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 14 Aug 2024 21:08:25 +0800 you wrote:
> Currently, we have histograms that show the sizes of ringbufs that ever
> used by SMC connections. However, they are always incremental and since
> SMC allows the reuse of ringbufs, we cannot know the actual amount of
> ringbufs being allocated or actively used.
> 
> So this patch set introduces statistics for the amount of ringbufs that
> actually allocated by link group and actively used by connections of a
> certain net namespace, so that we can react based on these memory usage
> information, e.g. active fallback to TCP.
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/2] net/smc: introduce statistics for allocated ringbufs of link group
    https://git.kernel.org/netdev/net-next/c/d386d59b7c1a
  - [net-next,v3,2/2] net/smc: introduce statistics for ringbufs usage of net namespace
    https://git.kernel.org/netdev/net-next/c/e0d103542b06

You are awesome, thank you!