提交 d0ead157 编写于 作者: T Tejun Heo 提交者: H. Peter Anvin

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: NTejun 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: NH. Peter Anvin <hpa@linux.intel.com>
上级 620917de
...@@ -34,15 +34,15 @@ static inline void resume_map_numa_kva(pgd_t *pgd) {} ...@@ -34,15 +34,15 @@ static inline void resume_map_numa_kva(pgd_t *pgd) {}
* 64Gb / 4096bytes/page = 16777216 pages * 64Gb / 4096bytes/page = 16777216 pages
*/ */
#define MAX_NR_PAGES 16777216 #define MAX_NR_PAGES 16777216
#define MAX_ELEMENTS 1024 #define MAX_SECTIONS 1024
#define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS) #define PAGES_PER_SECTION (MAX_NR_PAGES/MAX_SECTIONS)
extern s8 physnode_map[]; extern s8 physnode_map[];
static inline int pfn_to_nid(unsigned long pfn) static inline int pfn_to_nid(unsigned long pfn)
{ {
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
return((int) physnode_map[(pfn) / PAGES_PER_ELEMENT]); return((int) physnode_map[(pfn) / PAGES_PER_SECTION]);
#else #else
return 0; return 0;
#endif #endif
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
* physnode_map[16-31] = 1; * physnode_map[16-31] = 1;
* physnode_map[32- ] = -1; * physnode_map[32- ] = -1;
*/ */
s8 physnode_map[MAX_ELEMENTS] __read_mostly = { [0 ... (MAX_ELEMENTS - 1)] = -1}; s8 physnode_map[MAX_SECTIONS] __read_mostly = { [0 ... (MAX_SECTIONS - 1)] = -1};
EXPORT_SYMBOL(physnode_map); EXPORT_SYMBOL(physnode_map);
void memory_present(int nid, unsigned long start, unsigned long end) void memory_present(int nid, unsigned long start, unsigned long end)
...@@ -52,8 +52,8 @@ void memory_present(int nid, unsigned long start, unsigned long end) ...@@ -52,8 +52,8 @@ void memory_present(int nid, unsigned long start, unsigned long end)
nid, start, end); nid, start, end);
printk(KERN_DEBUG " Setting physnode_map array to node %d for pfns:\n", nid); printk(KERN_DEBUG " Setting physnode_map array to node %d for pfns:\n", nid);
printk(KERN_DEBUG " "); printk(KERN_DEBUG " ");
for (pfn = start; pfn < end; pfn += PAGES_PER_ELEMENT) { for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
physnode_map[pfn / PAGES_PER_ELEMENT] = nid; physnode_map[pfn / PAGES_PER_SECTION] = nid;
printk(KERN_CONT "%lx ", pfn); printk(KERN_CONT "%lx ", pfn);
} }
printk(KERN_CONT "\n"); printk(KERN_CONT "\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册