From nobody Tue Apr 28 19:32:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7343C433F5 for ; Mon, 30 May 2022 11:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235765AbiE3Luh (ORCPT ); Mon, 30 May 2022 07:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234546AbiE3Lue (ORCPT ); Mon, 30 May 2022 07:50:34 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2428B69CF6 for ; Mon, 30 May 2022 04:50:33 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D72CC113E; Mon, 30 May 2022 04:50:32 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.36.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B0F893F766; Mon, 30 May 2022 04:50:30 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , Zi Yan , linux-kernel@vger.kernel.org Subject: [RFC] mm/page_isolation: Fix an infinite loop in isolate_single_pageblock() Date: Mon, 30 May 2022 17:20:27 +0530 Message-Id: <20220530115027.123341-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" HugeTLB allocation (32MB pages on 4K base page) via sysfs on arm64 platform is getting stuck in isolate_single_pageblock(), because of an infinite loop Because head_pfn always evaluate the same, so does pfn, and the outer loop never exits. Dropping the relevant code block, which seems redundant, makes the problem go away. Cc: Andrew Morton Cc: Zi Yan Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Fixes: b2c9e2fbba32 ("mm: make alloc_contig_range work at pageblock granula= rity") Signed-off-by: Anshuman Khandual --- I am not sure about this fix, and also did not find much time today to debug any further. There are much code changes around this function in recent days. This problem is present on latest mainline kernel. - Anshuman mm/page_isolation.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 6021f8444b5a..b0922fee75c1 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -389,10 +389,6 @@ static int isolate_single_pageblock(unsigned long boun= dary_pfn, int flags, struct page *head =3D compound_head(page); unsigned long head_pfn =3D page_to_pfn(head); =20 - if (head_pfn + nr_pages <=3D boundary_pfn) { - pfn =3D head_pfn + nr_pages; - continue; - } #if defined CONFIG_COMPACTION || defined CONFIG_CMA /* * hugetlb, lru compound (THP), and movable compound pages --=20 2.20.1