From: Jonathan Corbet <corbet@lwn.net>
To: Li Zhijian <lizhijian@fujitsu.com>, linux-doc@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
mkoutny@suse.com, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, Waiman Long <llong@redhat.com>,
Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH v2] Documentation/cgroup-v2: Update memory.{stat,numa_stat} description to reflect possible units
Date: Mon, 13 Jan 2025 10:49:40 -0700 [thread overview]
Message-ID: <871px6bo3v.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20250113010530.432396-1-lizhijian@fujitsu.com>
Li Zhijian <lizhijian@fujitsu.com> writes:
> The description of the memory.{stat,numa_stat} file has been updated to
> clarify that the output values can be in bytes or pages.
> This change ensures that users are aware that the unit of measurement for
> memory values can vary and should be verified by consulting the memory.stat
>
> It's known that
> workingset_*, pg* are counted in pages
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>a
> ---
> V2: updated the document as suggestion from Michal
> updated subject and commit log
> ---
> Documentation/admin-guide/cgroup-v2.rst | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
> index 315ede811c9d..0a43be0c32d1 100644
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -1427,7 +1427,7 @@ The following nested keys are defined.
> types of memory, type-specific details, and other information
> on the state and past events of the memory management system.
>
> - All memory amounts are in bytes.
> + All memory amounts are in bytes unless said otherwise.
>
> The entries are ordered to be human readable, and new entries
> can show up in the middle. Don't rely on items remaining in a
> @@ -1673,11 +1673,12 @@ The following nested keys are defined.
> application performance by combining this information with the
> application's CPU allocation.
>
> - All memory amounts are in bytes.
> -
> The output format of memory.numa_stat is::
>
> - type N0=<bytes in node 0> N1=<bytes in node 1> ...
> + type N0=<value for node 0> N1=<value for node 1> ...
> +
> + The 'value' can be in bytes or pages, depending on the specific
> + type of memory. To determine the unit, refer to the memory.stat.
This seems like useful information - but can we really not give better
guidance to our readers on how to interpret this value? What in "the
memory.stat" will tell them which units are in use?
(Even better, could we fix the code to always return the same units
without breaking something somewhere?)
Thanks,
jon
next prev parent reply other threads:[~2025-01-13 17:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 12:30 [PATCH] Documentation/cgroup-v2: Update memory.numa_stat description to reflect possible units Li Zhijian
2025-01-10 15:26 ` Waiman Long
2025-01-10 15:35 ` Michal Koutný
2025-01-13 0:38 ` Zhijian Li (Fujitsu)
2025-01-13 1:05 ` [PATCH v2] Documentation/cgroup-v2: Update memory.{stat,numa_stat} " Li Zhijian
2025-01-13 8:58 ` Bagas Sanjaya
2025-01-13 17:49 ` Jonathan Corbet [this message]
2025-01-16 5:50 ` Zhijian Li (Fujitsu)
2025-01-16 15:12 ` Jonathan Corbet
2025-01-16 17:19 ` Tejun Heo
2025-01-17 3:09 ` Zhijian Li (Fujitsu)
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=871px6bo3v.fsf@trenco.lwn.net \
--to=corbet@lwn.net \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhijian@fujitsu.com \
--cc=llong@redhat.com \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
/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