* [PATCH] Read cpumasks every time when exporting through sysfs
@ 2004-08-16 1:26 Rusty Russell
2004-08-16 6:08 ` Paul Jackson
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2004-08-16 1:26 UTC (permalink / raw)
To: Andrew Morton; +Cc: lkml - Kernel Mailing List, pj
Name: Read cpumasks every time when exporting through sysfs
Status: Booted on 2.6.7-rc2-bk7
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Paul Jackson points out that the sysfs code saves a node's cpumask in
the sysfs node, although it can change with CPU hotplug. Don't do
this.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .4860-linux-2.6.7-rc2-bk7/drivers/base/node.c .4860-linux-2.6.7-rc2-bk7.updated/drivers/base/node.c
--- .4860-linux-2.6.7-rc2-bk7/drivers/base/node.c 2004-06-07 07:47:33.000000000 +1000
+++ .4860-linux-2.6.7-rc2-bk7.updated/drivers/base/node.c 2004-06-07 12:26:16.000000000 +1000
@@ -18,7 +18,7 @@ static struct sysdev_class node_class =
static ssize_t node_read_cpumap(struct sys_device * dev, char * buf)
{
struct node *node_dev = to_node(dev);
- cpumask_t mask = node_dev->cpumap;
+ cpumask_t mask = node_to_cpumask(node_dev->sysdev.id);
int len;
/* 2004/06/03: buf currently PAGE_SIZE, need > 1 char per 4 bits. */
@@ -116,7 +116,6 @@ int __init register_node(struct node *no
{
int error;
- node->cpumap = node_to_cpumask(num);
node->sysdev.id = num;
node->sysdev.cls = &node_class;
error = sysdev_register(&node->sysdev);
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .4860-linux-2.6.7-rc2-bk7/include/linux/node.h .4860-linux-2.6.7-rc2-bk7.updated/include/linux/node.h
--- .4860-linux-2.6.7-rc2-bk7/include/linux/node.h 2003-09-22 10:27:37.000000000 +1000
+++ .4860-linux-2.6.7-rc2-bk7.updated/include/linux/node.h 2004-06-07 12:24:47.000000000 +1000
@@ -23,7 +23,6 @@
#include <linux/cpumask.h>
struct node {
- cpumask_t cpumap; /* Bitmap of CPUs on the Node */
struct sys_device sysdev;
};
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Read cpumasks every time when exporting through sysfs
2004-08-16 1:26 [PATCH] Read cpumasks every time when exporting through sysfs Rusty Russell
@ 2004-08-16 6:08 ` Paul Jackson
0 siblings, 0 replies; 2+ messages in thread
From: Paul Jackson @ 2004-08-16 6:08 UTC (permalink / raw)
To: Rusty Russell; +Cc: akpm, linux-kernel
Rusty wrote:
> Read cpumasks every time when exporting through sysfs
Thanks, Rusty.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-16 6:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-16 1:26 [PATCH] Read cpumasks every time when exporting through sysfs Rusty Russell
2004-08-16 6:08 ` Paul Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox