Commit c036ddff authored by Miaohe Lin's avatar Miaohe Lin Committed by akpm

mm: compaction: use COMPACT_CLUSTER_MAX in compaction.c

Always use COMPACT_CLUSTER_MAX here as we're doing the compaction.  Minor
improvements in readability.

Link: https://lkml.kernel.org/r/20220418141253.24298-7-linmiaohe@huawei.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Cc: Charan Teja Kalla <charante@codeaurora.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Pintu Kumar <pintu@codeaurora.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 85f73e6d
...@@ -573,7 +573,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, ...@@ -573,7 +573,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
* contention, to give chance to IRQs. Abort if fatal signal * contention, to give chance to IRQs. Abort if fatal signal
* pending. * pending.
*/ */
if (!(blockpfn % SWAP_CLUSTER_MAX) if (!(blockpfn % COMPACT_CLUSTER_MAX)
&& compact_unlock_should_abort(&cc->zone->lock, flags, && compact_unlock_should_abort(&cc->zone->lock, flags,
&locked, cc)) &locked, cc))
break; break;
...@@ -862,7 +862,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, ...@@ -862,7 +862,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
* contention, to give chance to IRQs. Abort completely if * contention, to give chance to IRQs. Abort completely if
* a fatal signal is pending. * a fatal signal is pending.
*/ */
if (!(low_pfn % SWAP_CLUSTER_MAX)) { if (!(low_pfn % COMPACT_CLUSTER_MAX)) {
if (locked) { if (locked) {
unlock_page_lruvec_irqrestore(locked, flags); unlock_page_lruvec_irqrestore(locked, flags);
locked = NULL; locked = NULL;
...@@ -1614,7 +1614,7 @@ static void isolate_freepages(struct compact_control *cc) ...@@ -1614,7 +1614,7 @@ static void isolate_freepages(struct compact_control *cc)
* This can iterate a massively long zone without finding any * This can iterate a massively long zone without finding any
* suitable migration targets, so periodically check resched. * suitable migration targets, so periodically check resched.
*/ */
if (!(block_start_pfn % (SWAP_CLUSTER_MAX * pageblock_nr_pages))) if (!(block_start_pfn % (COMPACT_CLUSTER_MAX * pageblock_nr_pages)))
cond_resched(); cond_resched();
page = pageblock_pfn_to_page(block_start_pfn, block_end_pfn, page = pageblock_pfn_to_page(block_start_pfn, block_end_pfn,
...@@ -1921,7 +1921,7 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc) ...@@ -1921,7 +1921,7 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc)
* many pageblocks unsuitable, so periodically check if we * many pageblocks unsuitable, so periodically check if we
* need to schedule. * need to schedule.
*/ */
if (!(low_pfn % (SWAP_CLUSTER_MAX * pageblock_nr_pages))) if (!(low_pfn % (COMPACT_CLUSTER_MAX * pageblock_nr_pages)))
cond_resched(); cond_resched();
page = pageblock_pfn_to_page(block_start_pfn, page = pageblock_pfn_to_page(block_start_pfn,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment