net: fix memcg overhead caused by sk->sk_forward_alloc size
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: Keep sk->sk_forward_alloc as a proper sizeinclude/ | +22 | 2 replies | |
| 2/2 | net: Add sysctl_reclaim_thresholdDocumentation/ include/ net/ | +32 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Long Tao | Jesse Brandeburg | Tim Chen | Suresh Srinivas |
|---|---|---|---|---|
| 1/2 | T-b | R-b | R-b | R-b |
| 2/2 | R-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH 0/2] net: fix memcg overhead caused by sk->sk_forward_alloc size
Dear Reviewers,
memcg charge overhead is observed while we benchmark memcached with memtier by running containers. It's caused by commit 4890b686f408 ("net:
Keep sk->sk_forward_alloc as small as possible"), which aims to reduce system memory pressure, but makes the per-socket forward allocated memory too small. The impact of this change is to trigger more frequently memory allocation during TCP connection lifecycle and leads to memcg charge overhead finally.
To avoid memcg charge overhead mentioned above, this series defines 64KB as reclaim threshold when uncharging per-socket memory. It reduces the frequency of memory allocation and charging during TCP connection, and it's much less than the original 2MB per-socket reserved memory before commit 4890b686f408 ("net: keep sk->sk_forward_alloc as small as possibile"). Run memcached/memtier test with the 64KB reclaim threshold, RPS gains around 2.01x.
This series also provides a new ABI /proc/sys/net/core/reclaim_threshold with flexibility to tune the reclaim threshold according to system running status.
This series is based on the latest tip/master tree.
Thanks for your time to help review and your feedback will be greatly!
Cathy Zhang (2):
net: Keep sk->sk_forward_alloc as a proper size
net: Add sysctl_reclaim_threshold
Documentation/admin-guide/sysctl/net.rst | 12 ++++++++++++ include/net/sock.h | 24 +++++++++++++++++++++++- net/core/sysctl_net_core.c | 14 ++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-)
2.34.1