From: David Rientjes <rientjes@google.com>
To: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: gregkh@linuxfoundation.org, rafael@kernel.org,
akpm@linux-foundation.org, surenb@google.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
souravpanda@google.com
Subject: Re: [PATCH] vmstat: don't auto expand the sysfs files
Date: Sun, 24 Dec 2023 13:26:15 -0800 (PST) [thread overview]
Message-ID: <b1049bfa-68c4-e237-30a9-1514a378c7f1@google.com> (raw)
In-Reply-To: <CA+CK2bA2vZp3e+HHfB-sdLsPUYghMxvKcWURktDtNjwPL79Csw@mail.gmail.com>
On Thu, 14 Dec 2023, Pasha Tatashin wrote:
> > > Whenever a new fields are added one of the following: node_stat_item
> > > numa_stat_item zone_stat_item, the /sys/devices/system/node/nodeX/vmstat
> > > files are auto expanded.
> > >
> > > This is a problem, as sysfs files should be only one value per file.
> >
> > Does this patch address the one-value-per-file issue? (I think that ship
> > has sailed for vmstat.)
>
> That ship has sailed for vmstat, this patch addresses what was asked
> by GregKH: not to add new values to vmstat, as not to make the
> existing problem even worse. The sysfs file system has a one page
> limit per file. The developers will decide how to export the new items
> added to node_stat, numa_stat, zone_stat individually. Each new item
> can be exported in its own files, and must have its own documentation
> about interface stability, value meaning, and expectations when the
> stat file is absent.
>
As of at least 6.5, /proc/vmstat is a strict superset of the per-node
vmstat. Why is that a problem?
There's great benefit to being able to use the sample implementations to
parse either /proc/vmstat *or* the per-node vmstat and without needing to
read the per-node vmstat plus some new set of sysfs files that are
one-value-per-file. The per-node vmstat will always be multiple values,
in fact it's a key value pair.
I have to think that doing anything else for vmstat is just adding
complexity (like this patch) and actually making it *harder* on userspace
to read the data it needs.
Yes, the per-node vmstat likely shouldn't be in sysfs at all but it
appears to have been added there 13+ years ago because it was a convenient
place to add a per-node variant. That's not ideal, but owell.
next prev parent reply other threads:[~2023-12-24 21:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 15:46 Pasha Tatashin
2023-12-11 17:00 ` Matthew Wilcox
2023-12-11 17:09 ` Pasha Tatashin
2023-12-14 17:52 ` David Rientjes
2023-12-14 18:57 ` Pasha Tatashin
2023-12-24 21:26 ` David Rientjes [this message]
2023-12-26 17:26 ` Pasha Tatashin
2023-12-27 0:53 ` Sysfs one-value-per-file (was Re: [PATCH] vmstat: don't auto expand the sysfs files) David Rientjes
2023-12-27 18:42 ` Andrew Morton
2023-12-28 14:48 ` Pasha Tatashin
2023-12-28 20:43 ` David Rientjes
2023-12-28 20:50 ` Pasha Tatashin
2023-12-28 10:17 ` Greg Kroah-Hartman
2023-12-28 20:52 ` David Rientjes
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=b1049bfa-68c4-e237-30a9-1514a378c7f1@google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pasha.tatashin@soleen.com \
--cc=rafael@kernel.org \
--cc=souravpanda@google.com \
--cc=surenb@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