Commit d0ead157387f19801beb1b419568723b2e9b7c79
Committed by
H. Peter Anvin
1 parent
620917de59
Exists in
master
and in
6 other branches
x86, mm: s/PAGES_PER_ELEMENT/PAGES_PER_SECTION/
DISCONTIGMEM on x86-32 implements pfn -> nid mapping similarly to SPARSEMEM; however, it calls each mapping unit ELEMENT instead of SECTION. This patch renames it to SECTION so that PAGES_PER_SECTION is valid for both DISCONTIGMEM and SPARSEMEM. This will be used by the next patch to implement mapping granularity check. This patch is trivial constant rename. Signed-off-by: Tejun Heo <tj@kernel.org> Link: http://lkml.kernel.org/r/20110712074422.GA2872@htj.dyndns.org Cc: Hans Rosenfeld <hans.rosenfeld@amd.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Showing 2 changed files with 6 additions and 6 deletions Side-by-side Diff
arch/x86/include/asm/mmzone_32.h
... | ... | @@ -34,15 +34,15 @@ |
34 | 34 | * 64Gb / 4096bytes/page = 16777216 pages |
35 | 35 | */ |
36 | 36 | #define MAX_NR_PAGES 16777216 |
37 | -#define MAX_ELEMENTS 1024 | |
38 | -#define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS) | |
37 | +#define MAX_SECTIONS 1024 | |
38 | +#define PAGES_PER_SECTION (MAX_NR_PAGES/MAX_SECTIONS) | |
39 | 39 | |
40 | 40 | extern s8 physnode_map[]; |
41 | 41 | |
42 | 42 | static inline int pfn_to_nid(unsigned long pfn) |
43 | 43 | { |
44 | 44 | #ifdef CONFIG_NUMA |
45 | - return((int) physnode_map[(pfn) / PAGES_PER_ELEMENT]); | |
45 | + return((int) physnode_map[(pfn) / PAGES_PER_SECTION]); | |
46 | 46 | #else |
47 | 47 | return 0; |
48 | 48 | #endif |
arch/x86/mm/numa_32.c
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | * physnode_map[16-31] = 1; |
42 | 42 | * physnode_map[32- ] = -1; |
43 | 43 | */ |
44 | -s8 physnode_map[MAX_ELEMENTS] __read_mostly = { [0 ... (MAX_ELEMENTS - 1)] = -1}; | |
44 | +s8 physnode_map[MAX_SECTIONS] __read_mostly = { [0 ... (MAX_SECTIONS - 1)] = -1}; | |
45 | 45 | EXPORT_SYMBOL(physnode_map); |
46 | 46 | |
47 | 47 | void memory_present(int nid, unsigned long start, unsigned long end) |
... | ... | @@ -52,8 +52,8 @@ |
52 | 52 | nid, start, end); |
53 | 53 | printk(KERN_DEBUG " Setting physnode_map array to node %d for pfns:\n", nid); |
54 | 54 | printk(KERN_DEBUG " "); |
55 | - for (pfn = start; pfn < end; pfn += PAGES_PER_ELEMENT) { | |
56 | - physnode_map[pfn / PAGES_PER_ELEMENT] = nid; | |
55 | + for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { | |
56 | + physnode_map[pfn / PAGES_PER_SECTION] = nid; | |
57 | 57 | printk(KERN_CONT "%lx ", pfn); |
58 | 58 | } |
59 | 59 | printk(KERN_CONT "\n"); |