]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: remove duplicated call of get_pfn_range_for_nid
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Thu, 27 Jun 2013 23:52:24 +0000 (09:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:38:05 +0000 (16:38 +1000)
commit2118e0f3a78870fb9b67f72a22c23086c89c25ab
treebfbafb6f3a5dd053ee7f827b33fdca67d502e0b5
parent68edc4398a0182a36bc088b6fe307b1baa929e25
mm: remove duplicated call of get_pfn_range_for_nid

When calculating pages in a node, for each zone in that node, we will have

  zone_spanned_pages_in_node
    --> get_pfn_range_for_nid
  zone_absent_pages_in_node
    --> get_pfn_range_for_nid

That is to say, we call the get_pfn_range_for_nid to get start_pfn and
end_pfn of the node for MAX_NR_ZONES * 2 times.  And this is totally
unnecessary if we call the get_pfn_range_for_nid before
zone_*_pages_in_node add two extra arguments node_start_pfn and
node_end_pfn for zone_*_pages_in_node, then we can remove the
get_pfn_range_in_node in zone_*_pages_in_node.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c