Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234893
b: refs/heads/master
c: ce00333
h: refs/heads/master
i:
  234891: 6f303a7
v: v3
  • Loading branch information
Yinghai Lu authored and Tejun Heo committed Mar 2, 2011
1 parent 3891817 commit 5a0030e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 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: cc28989437de5617875a2943697fe6ba51a0da8f
refs/heads/master: ce0033307f1b45e23e0c149f56ea4855eb4687ce
8 changes: 3 additions & 5 deletions trunk/arch/x86/mm/numa_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,12 @@ static void __init numa_nodemask_from_meminfo(nodemask_t *nodemask,
*/
void __init numa_reset_distance(void)
{
size_t size;
size_t size = numa_distance_cnt * numa_distance_cnt * sizeof(numa_distance[0]);

if (numa_distance_cnt) {
size = numa_distance_cnt * sizeof(numa_distance[0]);
if (numa_distance_cnt)
memblock_x86_free_range(__pa(numa_distance),
__pa(numa_distance) + size);
numa_distance_cnt = 0;
}
numa_distance_cnt = 0;
numa_distance = NULL;
}

Expand Down
14 changes: 8 additions & 6 deletions trunk/arch/x86/mm/numa_emulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
static struct numa_meminfo pi __initdata;
const u64 max_addr = max_pfn << PAGE_SHIFT;
u8 *phys_dist = NULL;
size_t phys_size = numa_dist_cnt * numa_dist_cnt * sizeof(phys_dist[0]);
int i, j, ret;

if (!emu_cmdline)
Expand Down Expand Up @@ -336,21 +337,18 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
goto no_emu;
}

/*
* Copy the original distance table. It's temporary so no need to
* reserve it.
*/
/* copy the physical distance table */
if (numa_dist_cnt) {
size_t size = numa_dist_cnt * sizeof(phys_dist[0]);
u64 phys;

phys = memblock_find_in_range(0,
(u64)max_pfn_mapped << PAGE_SHIFT,
size, PAGE_SIZE);
phys_size, PAGE_SIZE);
if (phys == MEMBLOCK_ERROR) {
pr_warning("NUMA: Warning: can't allocate copy of distance table, disabling emulation\n");
goto no_emu;
}
memblock_x86_reserve_range(phys, phys + phys_size, "TMP NUMA DIST");
phys_dist = __va(phys);

for (i = 0; i < numa_dist_cnt; i++)
Expand Down Expand Up @@ -398,6 +396,10 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
numa_set_distance(i, j, dist);
}
}

/* free the copied physical distance table */
if (phys_dist)
memblock_x86_free_range(__pa(phys_dist), __pa(phys_dist) + phys_size);
return;

no_emu:
Expand Down

0 comments on commit 5a0030e

Please sign in to comment.