Skip to content

Commit

Permalink
mm, compaction: remove unneeded pageblock_skip_persistent() checks
Browse files Browse the repository at this point in the history
Commit f3c9316 ("mm, compaction: persistently skip hugetlbfs
pageblocks") has introduced pageblock_skip_persistent() checks into
migration and free scanners, to make sure pageblocks that should be
persistently skipped are marked as such, regardless of the
ignore_skip_hint flag.

Since the previous patch introduced a new no_set_skip_hint flag, the
ignore flag no longer prevents marking pageblocks as skipped.  Therefore
we can remove the special cases.  The relevant pageblocks will be marked
as skipped by the common logic which marks each pageblock where no page
could be isolated.  This makes the code simpler.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Vlastimil Babka <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tehcaster authored and torvalds committed Nov 18, 2017
1 parent 2583d67 commit d3c85ba
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
if (PageCompound(page)) {
const unsigned int order = compound_order(page);

if (pageblock_skip_persistent(page, order)) {
set_pageblock_skip(page);
blockpfn = end_pfn;
} else if (likely(order < MAX_ORDER)) {
if (likely(order < MAX_ORDER)) {
blockpfn += (1UL << order) - 1;
cursor += (1UL << order) - 1;
}
Expand Down Expand Up @@ -801,10 +798,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
if (PageCompound(page)) {
const unsigned int order = compound_order(page);

if (pageblock_skip_persistent(page, order)) {
set_pageblock_skip(page);
low_pfn = end_pfn;
} else if (likely(order < MAX_ORDER))
if (likely(order < MAX_ORDER))
low_pfn += (1UL << order) - 1;
goto isolate_fail;
}
Expand Down Expand Up @@ -867,13 +861,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
* is safe to read and it's 0 for tail pages.
*/
if (unlikely(PageCompound(page))) {
const unsigned int order = compound_order(page);

if (pageblock_skip_persistent(page, order)) {
set_pageblock_skip(page);
low_pfn = end_pfn;
} else
low_pfn += (1UL << order) - 1;
low_pfn += (1UL << compound_order(page)) - 1;
goto isolate_fail;
}
}
Expand Down

0 comments on commit d3c85ba

Please sign in to comment.