diff mbox series

mm: compaction: use helper isolation_suitable

Message ID 20220322110750.60311-1-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series mm: compaction: use helper isolation_suitable | expand

Commit Message

Miaohe Lin March 22, 2022, 11:07 a.m. UTC
Use helper isolation_suitable to check whether page is suitable to isolate
to simplify the code. Minor readability improvement.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wei Yang March 26, 2022, 9:43 a.m. UTC | #1
On Tue, Mar 22, 2022 at 07:07:50PM +0800, Miaohe Lin wrote:
>Use helper isolation_suitable to check whether page is suitable to isolate
>to simplify the code. Minor readability improvement.
>
>Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Wei Yang <richard.weiyang@gmail.com>

>---
> mm/compaction.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/mm/compaction.c b/mm/compaction.c
>index c3e37aa9ff9e..86f34053c39d 100644
>--- a/mm/compaction.c
>+++ b/mm/compaction.c
>@@ -899,7 +899,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
> 		 * not falsely conclude that the block should be skipped.
> 		 */
> 		if (!valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages)) {
>-			if (!cc->ignore_skip_hint && get_pageblock_skip(page)) {
>+			if (!isolation_suitable(cc, page)) {
> 				low_pfn = end_pfn;
> 				page = NULL;
> 				goto isolate_abort;
>-- 
>2.23.0
diff mbox series

Patch

diff --git a/mm/compaction.c b/mm/compaction.c
index c3e37aa9ff9e..86f34053c39d 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -899,7 +899,7 @@  isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 		 * not falsely conclude that the block should be skipped.
 		 */
 		if (!valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages)) {
-			if (!cc->ignore_skip_hint && get_pageblock_skip(page)) {
+			if (!isolation_suitable(cc, page)) {
 				low_pfn = end_pfn;
 				page = NULL;
 				goto isolate_abort;