lkml.org 
[lkml]   [2008]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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)
{

\
 
 \ /
  Last update: 2008-02-20 09:43    [W:3.079 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site