Re: [PATCH/RFC] Add node 'states' sysfs class attribute - V2
From: Lee Schermerhorn <hidden>
Date: 2007-08-29 14:43:40
On Tue, 2007-08-28 at 15:13 -0700, Nish Aravamudan wrote:
On 8/28/07, Christoph Lameter [off-list ref] wrote:quoted
On Tue, 28 Aug 2007, Lee Schermerhorn wrote:quoted
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.Right. That is the right place.quoted
I'm not wedded to this interface. However, I realy don't think it's worth doing as multiple files.I think one single file per nodemask makes sense. Otherwise files become difficult to parse. I just forgot....quoted
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.I would suggest to do the one file thing in sysfs and use the function that already exists in the kernel to print the nice nodelists. Using the nice function is just calling another function since the code is already there. At some point we may even allow changing the nodemasks. One could imagine that we would add nodemasks that allow use of hugepages on certain nodes or the slab allocator to allocate on certain nodes.Just to chime in here -- I've been on vacation for a bit recently -- I fully support the one-value per file rule for sysfs. I think it makes things a bit clearer. I like this attribute as well, and the idea of expanding it down the road is easiest if we use one file per-nodemask.
Welcome back, Nish. OK, I relent. I'll respin with one file per state. I'll go with a slight modification to the names suggested by Yasunori-san: possible, online, has_memory, has_cpu Some come, mon... 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>