Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277141
b: refs/heads/master
c: b2fea98
h: refs/heads/master
i:
  277139: 1e63d0d
v: v3
  • Loading branch information
Tejun Heo authored and H. Peter Anvin committed Jul 14, 2011
1 parent 8a45574 commit 1042bf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 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: c13291a536b835b2ab278ab201f2cb1ce22f2785
refs/heads/master: b2fea988f4f3b38ff4edfc1556a843c91932804c
20 changes: 3 additions & 17 deletions trunk/mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,28 +511,14 @@ phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align)
phys_addr_t __weak __init memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid)
{
#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
/*
* This code originates from sparc which really wants use to walk by addresses
* and returns the nid. This is not very convenient for early_pfn_map[] users
* as the map isn't sorted yet, and it really wants to be walked by nid.
*
* For now, I implement the inefficient method below which walks the early
* map multiple times. Eventually we may want to use an ARCH config option
* to implement a completely different method for both case.
*/
unsigned long start_pfn, end_pfn;
int i;

for (i = 0; i < MAX_NUMNODES; i++) {
get_pfn_range_for_nid(i, &start_pfn, &end_pfn);
if (start < PFN_PHYS(start_pfn) || start >= PFN_PHYS(end_pfn))
continue;
*nid = i;
return min(end, PFN_PHYS(end_pfn));
}
for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, nid)
if (start >= PFN_PHYS(start_pfn) && start < PFN_PHYS(end_pfn))
return min(end, PFN_PHYS(end_pfn));
#endif
*nid = 0;

return end;
}

Expand Down

0 comments on commit 1042bf5

Please sign in to comment.