• Vlastimil Babka's avatar
    mm, compaction: wrap calculating first and last pfn of pageblock · 06b6640a
    Vlastimil Babka authored
    Compaction code has accumulated numerous instances of manual
    calculations of the first (inclusive) and last (exclusive) pfn of a
    pageblock (or a smaller block of given order), given a pfn within the
    pageblock.
    
    Wrap these calculations by introducing pageblock_start_pfn(pfn) and
    pageblock_end_pfn(pfn) macros.
    
    [vbabka@suse.cz: fix crash in get_pfnblock_flags_mask() from isolate_freepages():]
    Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Minchan Kim <minchan@kernel.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Hugh Dickins <hughd@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    06b6640a
compaction.c 52.8 KB