From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-mm <linux-mm@kvack.org>,
mel@skynet.ie, y-goto@jp.fujitsu.com,
Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
Eric Whitney <eric.whitney@hp.com>
Subject: Re: [PATCH/RFC] Add node 'states' sysfs class attribute
Date: Mon, 27 Aug 2007 16:08:53 -0400 [thread overview]
Message-ID: <1188245333.5952.84.camel@localhost> (raw)
In-Reply-To: <Pine.LNX.4.64.0708271203170.4667@schroedinger.engr.sgi.com>
On Mon, 2007-08-27 at 12:11 -0700, Christoph Lameter wrote:
> On Mon, 27 Aug 2007, Lee Schermerhorn wrote:
>
> > Works on my numa platform: 4 nodes with cpus, one memory only node.
> >
> > Questions:
> >
> > 1) if this is useful, do we need/want the possible mask?
>
> Yes that is important for software that wants to allocate per node
> structures. The possible mask shows which nodes could be activated later.
Good point. Given that, I'm thinking we might want to limit the
displayed masks--even the internal value of the mask--to something
closer to what a particular platform architecture can support, even tho'
the kernel might be configured for a much larger number. I'll have to
look into how to do this.
>
> > 2) how about teaching nodemask_scnprintf() to suppress leading
> > words of all zeros?
>
> Leading words of all zeroes? nodemask_scnprintf calls bitmap_scnprintf().
> Maybe it should call bitmap_scnlistprintf() instead?
For platforms with small numbers of possible nodes, that might look
nicer.
>
>
> > +static ssize_t
> > +print_node_states(struct class *class, char *buf)
> > +{
> > + int i;
> > + int n;
> > + size_t size = PAGE_SIZE;
> > + ssize_t len = 0;
>
> The size varies? Isnt the len enough. Maybe just using one variable would
> simplify the code?
'size' is used as the remaining amount of space in the buffer for each
subsequent snprintf()-like call. But, yeah, I can just decrement size
after each call and at the end, subtract it from the original buffer
size--i.e., PAGE_SIZE--to get the length. Next respin.
>
> > +
> > + for (i=0; i < NR_NODE_STATES; ++i) {
>
> Missing blanks around assignment.
OK.
> Please use i++.
Sure. Old habits die hard.
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-27 20:08 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-24 22:28 + memoryless-nodes-fixup-uses-of-node_online_map-in-generic-code-fix.patch added to -mm tree akpm
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 [this message]
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
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=1188245333.5952.84.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.