* [PATCH] doc,cgroup-v2: memory.max is reported in multiples of page size
@ 2025-04-10 13:34 Vishal Chourasia
2025-04-10 13:47 ` Michal Koutný
0 siblings, 1 reply; 3+ messages in thread
From: Vishal Chourasia @ 2025-04-10 13:34 UTC (permalink / raw)
To: tj, hannes, mkoutny, corbet, cgroups, linux-doc, linux-kernel
Cc: Vishal Chourasia
Update documentation for memory.max to clarify that the reported value
is in multiples of the system page_size. The following example
demonstrates this behavior:
# cd /sys/fs/cgroup/
# cat cgroup.subtree_control
cpu io memory pids
# mkdir mem
# cd mem
# echo 8000000 > memory.max
# cat memory.max
7995392
# getconf PAGESIZE
65536
# echo $((8000000/65536*65536))
7995392
Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
---
Documentation/admin-guide/cgroup-v2.rst | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 1a16ce68a4d7..577d05c03ffa 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1316,6 +1316,9 @@ PAGE_SIZE multiple when read back.
Caller could retry them differently, return into userspace
as -ENOMEM or silently ignore in cases like disk readahead.
+ Note that the value set for memory.max is reported in units
+ corresponding to the system's page size.
+
memory.reclaim
A write-only nested-keyed file which exists for all cgroups.
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] doc,cgroup-v2: memory.max is reported in multiples of page size
2025-04-10 13:34 [PATCH] doc,cgroup-v2: memory.max is reported in multiples of page size Vishal Chourasia
@ 2025-04-10 13:47 ` Michal Koutný
2025-04-10 13:58 ` Vishal Chourasia
0 siblings, 1 reply; 3+ messages in thread
From: Michal Koutný @ 2025-04-10 13:47 UTC (permalink / raw)
To: Vishal Chourasia; +Cc: tj, hannes, corbet, cgroups, linux-doc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 961 bytes --]
Hello.
On Thu, Apr 10, 2025 at 07:04:40PM +0530, Vishal Chourasia <vishalc@linux.ibm.com> wrote:
> Update documentation for memory.max to clarify that the reported value
> is in multiples of the system page_size. The following example
> demonstrates this behavior:
This applies to any of page_counter-based attribute, not only
memory.max.
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -1316,6 +1316,9 @@ PAGE_SIZE multiple when read back.
> Caller could retry them differently, return into userspace
> as -ENOMEM or silently ignore in cases like disk readahead.
>
> + Note that the value set for memory.max is reported in units
> + corresponding to the system's page size.
> +
There seems to be mismatch in whitespace to surrounding text.
Also the wording would be more precise if it referred to 'multiples',
not 'units' (units are simply bytes).
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] doc,cgroup-v2: memory.max is reported in multiples of page size
2025-04-10 13:47 ` Michal Koutný
@ 2025-04-10 13:58 ` Vishal Chourasia
0 siblings, 0 replies; 3+ messages in thread
From: Vishal Chourasia @ 2025-04-10 13:58 UTC (permalink / raw)
To: Michal Koutný; +Cc: tj, hannes, corbet, cgroups, linux-doc, linux-kernel
On Thu, Apr 10, 2025 at 03:47:06PM +0200, Michal Koutný wrote:
> Hello.
>
> On Thu, Apr 10, 2025 at 07:04:40PM +0530, Vishal Chourasia <vishalc@linux.ibm.com> wrote:
> > Update documentation for memory.max to clarify that the reported value
> > is in multiples of the system page_size. The following example
> > demonstrates this behavior:
>
> This applies to any of page_counter-based attribute, not only
> memory.max.
>
Yes. This is already documented, and I missed it.
From Documentation/admin-api/cgroup-v2.rst:
...
Memory Interface Files
~~~~~~~~~~~~~~~~~~~~~~
All memory amounts are in bytes. If a value which is not aligned to
PAGE_SIZE is written, the value may be rounded up to the closest
PAGE_SIZE multiple when read back.
...
> > --- a/Documentation/admin-guide/cgroup-v2.rst
> > +++ b/Documentation/admin-guide/cgroup-v2.rst
> > @@ -1316,6 +1316,9 @@ PAGE_SIZE multiple when read back.
> > Caller could retry them differently, return into userspace
> > as -ENOMEM or silently ignore in cases like disk readahead.
> >
> > + Note that the value set for memory.max is reported in units
> > + corresponding to the system's page size.
> > +
>
> There seems to be mismatch in whitespace to surrounding text.
>
> Also the wording would be more precise if it referred to 'multiples',
> not 'units' (units are simply bytes).
>
> Michal
>
Got it. But, it seems this patch is redundant. So, I won't be sending
another version.
Thanks,
Vishal
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-10 13:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 13:34 [PATCH] doc,cgroup-v2: memory.max is reported in multiples of page size Vishal Chourasia
2025-04-10 13:47 ` Michal Koutný
2025-04-10 13:58 ` Vishal Chourasia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).