Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245712
b: refs/heads/master
c: 99cca49
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed May 2, 2011
1 parent 42c0f57 commit 09ec1e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38f3e1ca24cc3ec416855e02676f91c898a8a262
refs/heads/master: 99cca492ea8ced305bfd687521ed69fb9e0147aa
29 changes: 14 additions & 15 deletions trunk/arch/x86/mm/numa_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ void resume_map_numa_kva(pgd_t *pgd_base)
* opportunistically and the callers will fall back to other memory
* allocation mechanisms on failure.
*/
static __init void init_alloc_remap(int nid)
static __init void init_alloc_remap(int nid, u64 start, u64 end)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long end_pfn = end >> PAGE_SHIFT;
unsigned long size, pfn;
u64 node_pa, remap_pa;
void *remap_va;
Expand All @@ -276,24 +278,15 @@ static __init void init_alloc_remap(int nid)
* memory could be added but not currently present.
*/
printk(KERN_DEBUG "node %d pfn: [%lx - %lx]\n",
nid, node_start_pfn[nid], node_end_pfn[nid]);
if (node_start_pfn[nid] > max_pfn)
return;
if (!node_end_pfn[nid])
return;
if (node_end_pfn[nid] > max_pfn)
node_end_pfn[nid] = max_pfn;
nid, start_pfn, end_pfn);

/* calculate the necessary space aligned to large page size */
size = node_memmap_size_bytes(nid, node_start_pfn[nid],
min(node_end_pfn[nid], max_pfn));
size = node_memmap_size_bytes(nid, start_pfn, end_pfn);
size += ALIGN(sizeof(pg_data_t), PAGE_SIZE);
size = ALIGN(size, LARGE_PAGE_BYTES);

/* allocate node memory and the lowmem remap area */
node_pa = memblock_find_in_range(node_start_pfn[nid] << PAGE_SHIFT,
(u64)node_end_pfn[nid] << PAGE_SHIFT,
size, LARGE_PAGE_BYTES);
node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES);
if (node_pa == MEMBLOCK_ERROR) {
pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n",
size, nid);
Expand Down Expand Up @@ -391,8 +384,14 @@ void __init initmem_init(void)
get_memcfg_numa();
numa_init_array();

for_each_online_node(nid)
init_alloc_remap(nid);
for_each_online_node(nid) {
u64 start = (u64)node_start_pfn[nid] << PAGE_SHIFT;
u64 end = min((u64)node_end_pfn[nid] << PAGE_SHIFT,
(u64)max_pfn << PAGE_SHIFT);

if (start < end)
init_alloc_remap(nid, start, end);
}

#ifdef CONFIG_HIGHMEM
highstart_pfn = highend_pfn = max_pfn;
Expand Down

0 comments on commit 09ec1e3

Please sign in to comment.