[PATCH v8 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-04-11 Thread Jia He
This api is to find the memory region index of input pfn. With this helper, we can improve the loop in early_pfn_valid by recording last region index. If current pfn and last pfn are in the same memory region, we needn't do the unnecessary binary searches because the result of memblock_is_nomap is

[PATCH v8 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-04-11 Thread Jia He
This api is to find the memory region index of input pfn. With this helper, we can improve the loop in early_pfn_valid by recording last region index. If current pfn and last pfn are in the same memory region, we needn't do the unnecessary binary searches because the result of memblock_is_nomap is