The patch titled Subject: mm/memblock: introduce pfn_valid_region() has been removed from the -mm tree. Its filename was mm-memblock-introduce-pfn_valid_region.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Jia He <jia.he@xxxxxxxxxxxxxxxx> Subject: mm/memblock: introduce pfn_valid_region() b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. in early_pfn_valid(), we can record the last returned memblock region. If current pfn and last pfn are in the same memory region, we needn't do the unnecessary binary searches because memblock_is_nomap is the same result for whole memory region. Link: http://lkml.kernel.org/r/1530867675-9018-6-git-send-email-hejianet@xxxxxxxxx Signed-off-by: Jia He <jia.he@xxxxxxxxxxxxxxxx> Cc: AKASHI Takahiro <takahiro.akashi@xxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Daniel Jordan <daniel.m.jordan@xxxxxxxxxx> Cc: Daniel Vacek <neelx@xxxxxxxxxx> Cc: Eugeniu Rosca <erosca@xxxxxxxxxxxxxx> Cc: Gioh Kim <gi-oh.kim@xxxxxxxxxxxxxxxx> Cc: James Morse <james.morse@xxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Kemi Wang <kemi.wang@xxxxxxxxx> Cc: Laura Abbott <labbott@xxxxxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Nikolay Borisov <nborisov@xxxxxxxx> Cc: Pasha Tatashin <Pavel.Tatashin@xxxxxxxxxxxxx> Cc: Petr Tesarik <ptesarik@xxxxxxxx> Cc: Philip Derrin <philip@cog.systems> Cc: Russell King <linux@xxxxxxxxxxxxxxx> Cc: Steve Capper <steve.capper@xxxxxxx> Cc: Vladimir Murzin <vladimir.murzin@xxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Cc: Wei Yang <richard.weiyang@xxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Cc: YASUAKI ISHIMATSU <yasu.isimatu@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memblock.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) --- a/mm/memblock.c~mm-memblock-introduce-pfn_valid_region +++ a/mm/memblock.c @@ -1280,6 +1280,30 @@ unsigned long __init_memblock memblock_n return PHYS_PFN(regions[early_region_idx].base); } EXPORT_SYMBOL(memblock_next_valid_pfn); + +int pfn_valid_region(ulong pfn) +{ + ulong start_pfn, end_pfn; + struct memblock_type *type = &memblock.memory; + struct memblock_region *regions = type->regions; + + if (early_region_idx != -1) { + start_pfn = PFN_DOWN(regions[early_region_idx].base); + end_pfn = PFN_DOWN(regions[early_region_idx].base + + regions[early_region_idx].size); + + if (pfn >= start_pfn && pfn < end_pfn) + return !memblock_is_nomap( + ®ions[early_region_idx]); + } + + early_region_idx = memblock_search_pfn_regions(pfn); + if (early_region_idx == -1) + return false; + + return !memblock_is_nomap(®ions[early_region_idx]); +} +EXPORT_SYMBOL(pfn_valid_region); #endif /*CONFIG_HAVE_MEMBLOCK_PFN_VALID*/ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, _ Patches currently in -mm which might be from jia.he@xxxxxxxxxxxxxxxx are mm-page_alloc-reduce-unnecessary-binary-search-in-early_pfn_valid.patch