From nobody Sun May 5 15:42:03 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1561023695; cv=none; d=zoho.com; s=zohoarc; b=N00nVTVTMnnjZuEUaYmQIFzU0+bPogTtrupZTmaJA4k94TfYMgOhJZc8GadF649+n4yX/7JWrnMpWoVKK8UkPnqPdGXMnGPtRieTD3vUoaREiiPu79T9RFXA+TfqoAitZ7xIn0y6n+ctukFfVYrwG22xqT7DqTPBuHMog3YLtuw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561023695; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=3q4+chjyNWsCS6dbHCp3l8NXzXjXxLn8PwWrnMk7s3Q=; b=MEf5kLvhj4UghQfbchqJWOJROW0Bn747oGTZbmiqFM+2xU19tpn/Q4+vMSnsQlfwbxm1A0gQYv4uCnR+jF3v7ODE0gwTMPHqGxUKDHbqnbqoRoMcxjtF2KXEwOckFAbfsKRZphWTlkQkReFAeWnrtuUS7drRVnevgEpqwWMvd2E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1561023695132792.693411005426; Thu, 20 Jun 2019 02:41:35 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hdtYP-0002uv-77; Thu, 20 Jun 2019 09:40:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hdtYO-0002uk-6w for xen-devel@lists.xenproject.org; Thu, 20 Jun 2019 09:40:24 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6a94a476-933f-11e9-820c-57c41817da3c; Thu, 20 Jun 2019 09:40:19 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 795A9AED4; Thu, 20 Jun 2019 09:40:18 +0000 (UTC) X-Inumbo-ID: 6a94a476-933f-11e9-820c-57c41817da3c X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Thu, 20 Jun 2019 11:40:15 +0200 Message-Id: <20190620094015.21206-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH RFC] mm: fix regression with deferred struct page init X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Alexander Duyck MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Commit 0e56acae4b4dd4a9 ("mm: initialize MAX_ORDER_NR_PAGES at a time instead of doing larger sections") is causing a regression on some systems when the kernel is booted as Xen dom0. The system will just hang in early boot. Reason is an endless loop in get_page_from_freelist() in case the first zone looked at has no free memory. deferred_grow_zone() is always returning true due to the following code snipplet: /* If the zone is empty somebody else may have cleared out the zone */ if (!deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn, first_deferred_pfn)) { pgdat->first_deferred_pfn =3D ULONG_MAX; pgdat_resize_unlock(pgdat, &flags); return true; } This in turn results in the loop as get_page_from_freelist() is assuming forward progress can be made by doing some more struct page initialization. Fixes: 0e56acae4b4dd4a9 ("mm: initialize MAX_ORDER_NR_PAGES at a time inste= ad of doing larger sections") --- This patch makes my system boot again as Xen dom0, but I'm not really sure it is the correct way to do it, hence the RFC. Signed-off-by: Juergen Gross --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d66bc8abe0af..6ee754b5cd92 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1826,7 +1826,7 @@ deferred_grow_zone(struct zone *zone, unsigned int or= der) first_deferred_pfn)) { pgdat->first_deferred_pfn =3D ULONG_MAX; pgdat_resize_unlock(pgdat, &flags); - return true; + return false; } =20 /* --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel