提交 e90f22ed 编写于 作者: A Andi Kleen 提交者: Linus Torvalds

[PATCH] x86_64: Fix NUMA node lookup debug code which had bitrotted

Signed-off-by: NAndi Kleen <ak@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3506229f
...@@ -17,16 +17,15 @@ ...@@ -17,16 +17,15 @@
/* Simple perfect hash to map physical addresses to node numbers */ /* Simple perfect hash to map physical addresses to node numbers */
extern int memnode_shift; extern int memnode_shift;
extern u8 memnodemap[NODEMAPSIZE]; extern u8 memnodemap[NODEMAPSIZE];
extern int maxnode;
extern struct pglist_data *node_data[]; extern struct pglist_data *node_data[];
static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
{ {
int nid; unsigned nid;
VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE); VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE);
nid = memnodemap[addr >> memnode_shift]; nid = memnodemap[addr >> memnode_shift];
VIRTUAL_BUG_ON(nid > maxnode); VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]);
return nid; return nid;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册