Read cpumasks every time when exporting through sysfs
PATCH 1/1 Read cpumasks every time when exporting through sysfs
Name: Read cpumasks every time when exporting through sysfs
Status: Booted on 2.6.7-rc2-bk7
Signed-off-by Rusty Russell <[email protected]>
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.
drivers/base/node.c +1 -2
@@ -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);
include/linux/node.h +0 -1
@@ -23,7 +23,6 @@#include <linux/cpumask.h> struct node { -cpumask_t cpumap;/* Bitmap of CPUs on the Node */ struct sys_device sysdev; };
Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
Quoted 1 line · Rusty
Read cpumasks every time when exporting through sysfs
Thanks, Rusty.
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373