Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andi Kleen and committed by
Linus Torvalds
e90f22ed 3506229f

+2 -3
+2 -3
include/asm-x86_64/mmzone.h
··· 17 17 /* Simple perfect hash to map physical addresses to node numbers */ 18 18 extern int memnode_shift; 19 19 extern u8 memnodemap[NODEMAPSIZE]; 20 - extern int maxnode; 21 20 22 21 extern struct pglist_data *node_data[]; 23 22 24 23 static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) 25 24 { 26 - int nid; 25 + unsigned nid; 27 26 VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE); 28 27 nid = memnodemap[addr >> memnode_shift]; 29 - VIRTUAL_BUG_ON(nid > maxnode); 28 + VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); 30 29 return nid; 31 30 } 32 31