Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245687
b: refs/heads/master
c: 2a28634
h: refs/heads/master
i:
  245685: ae848fb
  245683: cb502bc
  245679: 9cd257e
v: v3
  • Loading branch information
Tejun Heo authored and H. Peter Anvin committed Apr 7, 2011
1 parent 18702fb commit 34c9b6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 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: 0e9f93c1c04c8ab10cc564df54a7ad0f83c67796
refs/heads/master: 2a286344f06d6341740b284494379373e87648f7
29 changes: 7 additions & 22 deletions trunk/arch/x86/mm/numa_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,6 @@ void *alloc_remap(int nid, unsigned long size)
return allocation;
}

static void __init remap_numa_kva(void)
{
void *vaddr;
unsigned long pfn;
int node;

for_each_online_node(node) {
printk(KERN_DEBUG "remap_numa_kva: node %d\n", node);
for (pfn=0; pfn < node_remap_size[node]; pfn += PTRS_PER_PTE) {
vaddr = node_remap_start_vaddr[node]+(pfn<<PAGE_SHIFT);
printk(KERN_DEBUG "remap_numa_kva: %08lx to pfn %08lx\n",
(unsigned long)vaddr,
node_remap_start_pfn[node] + pfn);
set_pmd_pfn((ulong) vaddr,
node_remap_start_pfn[node] + pfn,
PAGE_KERNEL_LARGE);
}
}
}

#ifdef CONFIG_HIBERNATION
/**
* resume_map_numa_kva - add KVA mapping to the temporary page tables created
Expand Down Expand Up @@ -262,7 +242,7 @@ void resume_map_numa_kva(pgd_t *pgd_base)

static __init unsigned long init_alloc_remap(int nid, unsigned long offset)
{
unsigned long size;
unsigned long size, pfn;
u64 node_pa, remap_pa;
void *remap_va;

Expand Down Expand Up @@ -308,6 +288,12 @@ static __init unsigned long init_alloc_remap(int nid, unsigned long offset)
memblock_x86_reserve_range(remap_pa, remap_pa + size, "KVA PG");
remap_va = phys_to_virt(remap_pa);

/* perform actual remap */
for (pfn = 0; pfn < size >> PAGE_SHIFT; pfn += PTRS_PER_PTE)
set_pmd_pfn((unsigned long)remap_va + (pfn << PAGE_SHIFT),
(node_pa >> PAGE_SHIFT) + pfn,
PAGE_KERNEL_LARGE);

/* initialize remap allocator parameters */
node_remap_start_pfn[nid] = node_pa >> PAGE_SHIFT;
node_remap_size[nid] = size >> PAGE_SHIFT;
Expand Down Expand Up @@ -363,7 +349,6 @@ void __init initmem_init(void)
(ulong) pfn_to_kaddr(max_low_pfn));
for_each_online_node(nid)
allocate_pgdat(nid);
remap_numa_kva();

printk(KERN_DEBUG "High memory starts at vaddr %08lx\n",
(ulong) pfn_to_kaddr(highstart_pfn));
Expand Down

0 comments on commit 34c9b6f

Please sign in to comment.