Messages in this thread Patch in this message | | | Date | Wed, 20 Feb 2008 00:32:04 -0800 | From | Yinghai Lu <> | Subject | [PATCH 1/4] make dev_to_node return online node |
| |
some numa system ( with multi HT chains) may return node without ram. aka it is not online. try to get one online node.
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
diff --git a/include/linux/device.h b/include/linux/device.h index 2258d89..7f1a4d7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -478,7 +478,12 @@ struct device { #ifdef CONFIG_NUMA static inline int dev_to_node(struct device *dev) { - return dev->numa_node; + int node; + node = dev->numa_node; + + if (node != -1 && !node_online(node)) + node = numa_node_id(); + return node; } static inline void set_dev_node(struct device *dev, int node) {
| |