mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cai Xinchen <caixinchen1@huawei.com>
To: <tj@kernel.org>, <hannes@cmpxchg.org>, <mkoutny@suse.com>,
	<corbet@lwn.net>, <skhan@linuxfoundation.org>,
	<rdunlap@infradead.org>, <edumazet@google.com>,
	<kuniyu@google.com>, <pabeni@redhat.com>, <willemb@google.com>,
	<davem@davemloft.net>, <kuba@kernel.org>, <horms@kernel.org>,
	<ncardwell@google.com>, <matttbe@kernel.org>,
	<martineau@kernel.org>, <geliang@kernel.org>, <mhocko@kernel.org>,
	<roman.gushchin@linux.dev>, <shakeel.butt@linux.dev>,
	<muchun.song@linux.dev>
Cc: <cgroups@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<mptcp@lists.linux.dev>, <linux-mm@kvack.org>,
	<linux-kselftest@vger.kernel.org>, <caixinchen1@huawei.com>,
	<lujialin4@huawei.com>
Subject: [PATCH RFC -next 4/5] Docs/admin-guide/cgroup-v2: document upfront socket budget charging
Date: Thu, 24 Sep 2026 16:02:18 +0800	[thread overview]
Message-ID: <20260924080219.1036588-5-caixinchen1@huawei.com> (raw)
In-Reply-To: <20260924080219.1036588-1-caixinchen1@huawei.com>

The "TCP socket buffers" entry in the memory.stat description leaves
the impression that the charge tracks in-flight packet buffers.
Since the budget-charging rework, a socket is instead charged its full
established memory budget (send buffer, receive buffer and
SO_RESERVE_MEM reservation) when the budget is created or resized, and
the charge is returned when the budget shrinks or the socket is
closed.  Say so.

Assisted-by: opencode:glm-5.3
Signed-off-by: Cai Xinchen <caixinchen1@huawei.com>
---
 Documentation/admin-guide/cgroup-v2.rst | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 8d2603751c51..4f26a459cfdc 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1309,7 +1309,11 @@ following types of memory usages are tracked.
 
 - Kernel data structures such as dentries and inodes.
 
-- TCP socket buffers.
+- TCP socket buffers. These are charged upfront for the socket's
+  established memory budget (send buffer, receive buffer and
+  SO_RESERVE_MEM reservation) when the budget is created or resized,
+  and returned when the budget shrinks or the socket is closed; the
+  charge is not tied to per-packet buffer usage.
 
 The above list may expand in the future for better coverage.
 
-- 
2.18.0.huawei.25


  parent reply	other threads:[~2026-09-24  7:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  8:02 [PATCH RFC -next 0/5] net: charge socket memory budget to memcg upfront Cai Xinchen
2026-09-24  8:02 ` [PATCH RFC -next 1/5] " Cai Xinchen
2026-09-24  8:02 ` [PATCH RFC -next 2/5] tcp: sync memcg budget on protocol buffer updates Cai Xinchen
2026-09-24  8:02 ` [PATCH RFC -next 3/5] mptcp: sync memcg budget and drop backlog page compensation Cai Xinchen
2026-09-24  8:02 ` Cai Xinchen [this message]
2026-09-24  8:02 ` [PATCH RFC -next 5/5] selftests/cgroup: compare socket memory deltas in test_memcg_sock Cai Xinchen
2026-09-24  8:26 ` [PATCH RFC -next 0/5] net: charge socket memory budget to memcg upfront Eric Dumazet
2026-09-24  9:25   ` Cai Xinchen
2026-09-24  9:28     ` Cai Xinchen
2026-09-24  9:55     ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924080219.1036588-5-caixinchen1@huawei.com \
    --to=caixinchen1@huawei.com \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=geliang@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lujialin4@huawei.com \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=mptcp@lists.linux.dev \
    --cc=muchun.song@linux.dev \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=skhan@linuxfoundation.org \
    --cc=tj@kernel.org \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®