diff --git a/drivers/soc/qcom/mem-offline.c b/drivers/soc/qcom/mem-offline.c index 9ce89e6fa54a..aa8e7caad5b7 100644 --- a/drivers/soc/qcom/mem-offline.c +++ b/drivers/soc/qcom/mem-offline.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. */ #include @@ -483,8 +483,9 @@ static void isolate_free_pages(struct movable_zone_fill_control *fc) * returning once we have SWAP_CLUSTER_MAX pages in the * free list for migration. */ - if (fc->nr_free_pages >= SWAP_CLUSTER_MAX || - has_pend_offline_req) + if (!((start_pfn + 1) % pageblock_nr_pages) && + (fc->nr_free_pages >= SWAP_CLUSTER_MAX || + has_pend_offline_req)) break; } fc->start_pfn = start_pfn + 1;