lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230508020801.10702-1-cathy.zhang@intel.com>
Date: Sun,  7 May 2023 19:07:59 -0700
From: Cathy Zhang <cathy.zhang@...el.com>
To: edumazet@...gle.com,
	davem@...emloft.net,
	kuba@...nel.org,
	pabeni@...hat.com
Cc: jesse.brandeburg@...el.com,
	suresh.srinivas@...el.com,
	tim.c.chen@...el.com,
	lizhen.you@...el.com,
	cathy.zhang@...el.com,
	eric.dumazet@...il.com,
	netdev@...r.kernel.org
Subject: [PATCH net-next 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.07x.

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 net-next/main 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                       | 32 +++++++++++++++++++++++-
 net/core/sysctl_net_core.c               | 14 +++++++++++
 3 files changed, 57 insertions(+), 1 deletion(-)


base-commit: ed23734c23d2fc1e6a1ff80f8c2b82faeed0ed0c
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ