diff options
author | Tejun Heo <tj@kernel.org> | 2011-07-12 10:46:31 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-07-14 20:45:32 +0200 |
commit | b2fea988f4f3b38ff4edfc1556a843c91932804c (patch) | |
tree | 4ab1227ab0a607ea44ba554468bda547a4d51eb5 /arch/sparc | |
parent | bootmem: Use for_each_mem_pfn_range() in page_alloc.c (diff) | |
download | linux-b2fea988f4f3b38ff4edfc1556a843c91932804c.tar.xz linux-b2fea988f4f3b38ff4edfc1556a843c91932804c.zip |
memblock: Improve generic memblock_nid_range() using for_each_mem_pfn_range()
Given an address range, memblock_nid_range() determines the node the
start of the range belongs to and upto where the range stays in the
same node.
It's implemented by calling get_pfn_range_for_nid(), which determines
min and max pfns for a given node, for each node and testing whether
start address falls in there. This is not only inefficient but also
incorrect when nodes interleave as min-max ranges for nodes overlap.
This patch reimplements memblock_nid_range() using
for_each_mem_pfn_range(). It's simpler, walks the mem ranges once and
can find the exact range the start address falls in.
Signed-off-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/1310460395-30913-5-git-send-email-tj@kernel.org
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/sparc')
0 files changed, 0 insertions, 0 deletions