• Zhang Yanfei's avatar
    mm: remove duplicated call of get_pfn_range_for_nid · 7960aedd
    Zhang Yanfei authored
    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.
    
    [akpm@linux-foundation.org: make definitions more readable]
    Signed-off-by: default avatarZhang Yanfei <zhangyanfei@cn.fujitsu.com>
    Cc: Michal Hocko <mhocko@suse.cz>
    Cc: Wu Fengguang <fengguang.wu@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    7960aedd
page_alloc.c 176 KB