linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	rafael@kernel.org,  Andrew Morton <akpm@linux-foundation.org>,
	surenb@google.com,  linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, souravpanda@google.com
Subject: Re: Sysfs one-value-per-file (was Re: [PATCH] vmstat: don't auto expand the sysfs files)
Date: Thu, 28 Dec 2023 12:52:32 -0800 (PST)	[thread overview]
Message-ID: <829410ca-1454-968e-b724-0ef0bfbca5cc@google.com> (raw)
In-Reply-To: <2023122824-washout-shrubs-1d6d@gregkh>

On Thu, 28 Dec 2023, Greg Kroah-Hartman wrote:

> > I'd argue that the ship on the "sysfs one-value-per-file rule" has sailed 
> > for long-standing use cases where either (1) switching is just not 
> > possible or (2) switching would be an undue burden to the user.
> > 
> > An example of (1) would be THP enablement and defrag options:
> > 
> > $ grep . /sys/kernel/mm/transparent_hugepage/{defrag,enabled,shmem_enabled}
> > /sys/kernel/mm/transparent_hugepage/defrag:always defer defer+madvise [madvise] never
> > /sys/kernel/mm/transparent_hugepage/enabled:[always] madvise never
> > /sys/kernel/mm/transparent_hugepage/shmem_enabled:always within_size advise [never] deny force
> > 
> > This convention isn't going to change.  We're not going to suddenly add a 
> > new enablement or defrag option that can only be set in a newly added 
> > file that is one-value-per-file.
> > 
> > THP was obviously introduced before any sysfs "one-value-per-file rule" 
> 
> No, the rule has been there since "day one" for sysfs, this file snuck
> in much later with no one noticing it against the "rules" and I've been
> complaining about it every time someone tries to add a new field to it
> that I notice.
> 

Ah, gotcha, thanks.  I had assumed that the push for one-value-per-file 
started after thp, and perhaps even because of thp :)  I have to admit 
that whenever I log into a new server type one of the first things I do is

$ cat /sys/devices/system/node/node*/distance

and that table just makes intuitive sense.  If we were to go back in time 
and reimplement that as one-value-per-file, I'd just assume that many 
userspace implementations would just need to read 64 different files to 
structure it into the same exact table.

On the other hand, I have wished countless times that the thp settings 
would have actually been one-value-per-file from the start.


      reply	other threads:[~2023-12-28 20:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 15:46 [PATCH] vmstat: don't auto expand the sysfs files 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
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 [this message]

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=829410ca-1454-968e-b724-0ef0bfbca5cc@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 \
    --cc=torvalds@linux-foundation.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