From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <clameter@sgi.com>,
linux-mm <linux-mm@kvack.org>,
mel@skynet.ie, y-goto@jp.fujitsu.com,
Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Eric Whitney <eric.whitney@hp.com>
Subject: Re: [PATCH/RFC] Add node 'states' sysfs class attribute - V2
Date: Tue, 28 Aug 2007 10:05:27 -0400 [thread overview]
Message-ID: <1188309928.5079.37.camel@localhost> (raw)
In-Reply-To: <20070827231214.99e3c33f.akpm@linux-foundation.org>
On Mon, 2007-08-27 at 23:12 -0700, Andrew Morton wrote:
> On Mon, 27 Aug 2007 22:53:15 -0700 (PDT) Christoph Lameter <clameter@sgi.com> wrote:
<something>
>
> > On Mon, 27 Aug 2007, Andrew Morton wrote:
<something else>
<and so on, ...>
Wow! Who'd have thought such a simple PATCH/RFC would generate such an
"animated" discussion!
Stepping back, as Andrew suggests, this all started when I added a
couple of temporary debug printk's to display the node state masks being
generated. I noted that I wasn't seeing the N_CPU mask getting
populated. [Turns out this was because I was printing too early--before
the other cpus came up and called process_zones().] Christoph suggested
that a /proc variable to display the maps would be useful to some
applications/shell scripts...
I thought I'd give it a try, but thinking that /proc variables were
discouraged, where else but sysfs to put them. A class attribute
to /sys/devices/system/node seemed like the appropriate place.
I do recall seeing the discussion/"golden rule" about a sysfs having a
single value, but:
1) I forgot.
2) I was making a change in drivers/base/node.c where I had the meminfo
"monstrosity" as an example
3) While it makes sense for settable attributes to be separate files,
for displaying a related set of info, like meminfo and node states, it
just seems silly to duplicate code and allocate multiple sysfs objects
for what can be done with so simply with a single file.
I'm not wedded to this interface. However, I realy don't think it's
worth doing as multiple files.
Regarding Andrew's comment about "user interface code in the kernel":
This was my reaction when I first encountered Linux's procfs with ascii
formatted files. I was coming from a Unix background with a binary
procfs interface. Again, it seemed silly to have "all that" formatting
and parsing code sitting around in the kernel, given how infrequently
its executed, in the grand scheme of things. However, I must admit that
I've become addicted to the ease with which one can write one-off
scripts to query configuration/statistics, tune/modify behavior or
trigger actions via just cat'ing from and/or echo'ing to a /proc or /sys
file.
So, where to go with this patch? Drop it? Leave it as is? Move
it /proc so that it can be a single file? Make it multiple files in
sysfs? Putting it as politely as possible, the last is not my favorite
option, but if folks think this info is useful and that's the way to go,
so be it. And what about mask vs list? It's a 4 character change in
the code to go either way.
Lee
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-08-28 14:05 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200708242228.l7OMS5fU017948@imap1.linux-foundation.org>
2007-08-27 15:58 ` [PATCH] 2.6.23-rc3-mm1 - update N_HIGH_MEMORY node state for memory hotadd Lee Schermerhorn
2007-08-27 17:48 ` [PATCH/RFC] Add node 'states' sysfs class attribute Lee Schermerhorn
2007-08-27 19:11 ` Christoph Lameter
2007-08-27 20:08 ` Lee Schermerhorn
2007-08-27 20:15 ` Christoph Lameter
2007-08-27 21:02 ` [PATCH/RFC] Add node 'states' sysfs class attribute - V2 Lee Schermerhorn
2007-08-27 21:04 ` Christoph Lameter
2007-08-28 0:01 ` Andrew Morton
2007-08-28 0:08 ` Christoph Lameter
2007-08-28 1:14 ` Andrew Morton
2007-08-28 1:29 ` Christoph Lameter
2007-08-28 3:18 ` Andrew Morton
2007-08-28 5:15 ` Christoph Lameter
2007-08-28 5:29 ` Andrew Morton
2007-08-28 5:34 ` Andrew Morton
2007-08-28 5:53 ` Christoph Lameter
2007-08-28 6:12 ` Andrew Morton
2007-08-28 14:05 ` Lee Schermerhorn [this message]
2007-08-28 22:02 ` Christoph Lameter
2007-08-28 22:13 ` Nish Aravamudan
2007-08-29 14:43 ` Lee Schermerhorn
2007-08-29 17:39 ` Christoph Lameter
2007-08-29 21:31 ` [PATCH/RFC] Add node states sysfs class attributeS - V3 Lee Schermerhorn
2007-08-29 22:14 ` Christoph Lameter
2007-08-30 13:34 ` Lee Schermerhorn
2007-08-29 22:36 ` Nish Aravamudan
2007-08-30 15:19 ` [PATCH/RFC] Add node states sysfs class attributeS - V4 Lee Schermerhorn
2007-08-30 16:44 ` Nish Aravamudan
2007-08-30 18:20 ` Christoph Lameter
2007-08-30 18:19 ` Christoph Lameter
2007-08-30 18:41 ` Lee Schermerhorn
2007-09-11 13:56 ` [PATCH/RFC] Add node states sysfs class attributeS - V5 Lee Schermerhorn
2007-09-11 20:25 ` Christoph Lameter
2007-09-14 10:50 ` Andrew Morton
2007-09-14 11:35 ` Andy Whitcroft
2007-09-14 14:34 ` Lee Schermerhorn
2007-09-14 14:43 ` Mel Gorman
2007-09-14 15:00 ` Paul Mundt
2007-09-16 12:10 ` Mel Gorman
2007-09-14 16:00 ` Martin J. Bligh
2007-08-28 19:34 ` [PATCH/RFC] Add node 'states' sysfs class attribute - V2 Christoph Lameter
2007-08-28 1:16 ` Yasunori Goto
2007-08-28 1:21 ` Yasunori Goto
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=1188309928.5079.37.camel@localhost \
--to=lee.schermerhorn@hp.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=eric.whitney@hp.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=mel@skynet.ie \
--cc=y-goto@jp.fujitsu.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