From nobody Mon Apr 29 13:58:05 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=1561046995; cv=none; d=zoho.com; s=zohoarc; b=hfu2z0Sk3rrrV+zDAlqhip1mE7a7GvSJ4jGgMX1xNUADXC6SYnQxj/NeDr/SYnMwt2Tcx1Ji0wuatN2QtUfnk6hYOQW+oULtmOuhyHEsw+oGI8gZSyXmDowKJT1duphlHRFNZoKLA3TphQRnvEsTB0B2xwdmzB3cDlB7fDfWXpY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561046995; 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=gNSgLYuPQcvUxKUrG/cl3PSbXnIAr0ZrR4Wn3mbvotU=; b=ThFTb3Gl6US3huQwzxlpomdr6mDtuuuR2jgcLqrkpgTz5uROiJmVTgQCiW8CPSS2PBhhnksQXmB0nXfW96wqsAhc59uPldofJ9mZsOZ7/ER0ldfThU2eZ1fQcpZSv1VOoicm5/aSGmO3fTnPz9tqsxJN4gL60btAVheoCspa9OU= 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 1561046995872764.6940723791663; Thu, 20 Jun 2019 09:09:55 -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 1hdzby-0001ec-GW; Thu, 20 Jun 2019 16:08:30 +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 1hdzbw-0001eX-QB for xen-devel@lists.xenproject.org; Thu, 20 Jun 2019 16:08:28 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a1661b34-9375-11e9-8c4b-f72420807426; Thu, 20 Jun 2019 16:08:24 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 979FEAF2B; Thu, 20 Jun 2019 16:08:23 +0000 (UTC) X-Inumbo-ID: a1661b34-9375-11e9-8c4b-f72420807426 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 18:08:21 +0200 Message-Id: <20190620160821.4210-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] 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. Cc: Alexander Duyck Fixes: 0e56acae4b4dd4a9 ("mm: initialize MAX_ORDER_NR_PAGES at a time inste= ad of doing larger sections") Suggested-by: Alexander Duyck Signed-off-by: Juergen Gross Acked-by: Alexander Duyck Acked-by: Michal Hocko --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d66bc8abe0af..8e3bc949ebcc 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1826,7 +1826,8 @@ 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; + /* Retry only once. */ + return first_deferred_pfn !=3D ULONG_MAX; } =20 /* --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel