From nobody Sat May 18 18:02:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1649323970; cv=none; d=zohomail.com; s=zohoarc; b=d0aAIrfscSf6Cr4HRC1jM9oIKdH+vHzv/oAIwkWyKCoqa4G+OR+TdizZgBo7KUQCpje9ljsZYy3KTtOrgXla6Sfm4flEryZHxF31UITXNzyraPjdgYfYmQxpnE2G8xtPmfonBOPo6JFtxTz1ZXO0dtsWTcTpntpsq+kzBOX1v68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649323970; 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; bh=iMz/fVk+XpC4IDojCtgZdhSbgaH5sJ66FU6YyYC0dAU=; b=EygB/PorCMoNpNR1tmgFyk7LdgX7Ke/8N0bltQ++xdfxBnCH8PIPVHXHA2Y5LLqXrkkO3xKO/nPA/k/pJOj/cjh+crd4QW/CSkFRBJqn1uLnNBXCkydSch+HSN8kmt2aYhR2HeNvn//hn6l29sEEfs8eonXO/7ieD36w8n8rip4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1649323970889296.25796776992763; Thu, 7 Apr 2022 02:32:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.300572.512763 (Exim 4.92) (envelope-from ) id 1ncOV7-0000q0-MG; Thu, 07 Apr 2022 09:32:25 +0000 Received: by outflank-mailman (output) from mailman id 300572.512763; Thu, 07 Apr 2022 09:32:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ncOV7-0000pt-JA; Thu, 07 Apr 2022 09:32:25 +0000 Received: by outflank-mailman (input) for mailman id 300572; Thu, 07 Apr 2022 09:32:25 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ncOV7-0000pn-1f for xen-devel@lists.xenproject.org; Thu, 07 Apr 2022 09:32:25 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a180c455-b655-11ec-a405-831a346695d4; Thu, 07 Apr 2022 11:32:24 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 94A37212C2; Thu, 7 Apr 2022 09:32:23 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5B6E913A66; Thu, 7 Apr 2022 09:32:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5vzuFKevTmJVLgAAMHmgww (envelope-from ); Thu, 07 Apr 2022 09:32:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a180c455-b655-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649323943; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMz/fVk+XpC4IDojCtgZdhSbgaH5sJ66FU6YyYC0dAU=; b=srp3svmAJ66vDcJogBKiIGdVGuq5CEJs6NzN+Dq5b4+v+huIvNyS5C2rdiaVbhfch0DbrT 75BoiGD0hZpc6CLImwmff34i2BgedTfCkHnIdUGSlX2blYRSglJ9ApB8mrYmE1yFAMAhOC HK7B66ciQOpkaSSp/7AQBiyKBcgA1u8= From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Andrew Morton , stable@vger.kernel.org, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [PATCH] mm, page_alloc: fix build_zonerefs_node() Date: Thu, 7 Apr 2022 11:32:21 +0200 Message-Id: <20220407093221.1090-1-jgross@suse.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1649323973389100001 Since commit 9d3be21bf9c0 ("mm, page_alloc: simplify zonelist initialization") only zones with free memory are included in a built zonelist. This is problematic when e.g. all memory of a zone has been ballooned out. Use populated_zone() when building a zonelist as it has been done before that commit. Cc: stable@vger.kernel.org Fixes: 9d3be21bf9c0 ("mm, page_alloc: simplify zonelist initialization") Reported-by: Marek Marczykowski-G=C3=B3recki Signed-off-by: Juergen Gross Acked-by: David Hildenbrand Acked-by: Michal Hocko Reviewed-by: Wei Yang --- 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 bdc8f60ae462..3d0662af3289 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6128,7 +6128,7 @@ static int build_zonerefs_node(pg_data_t *pgdat, stru= ct zoneref *zonerefs) do { zone_type--; zone =3D pgdat->node_zones + zone_type; - if (managed_zone(zone)) { + if (populated_zone(zone)) { zoneref_set_zone(zone, &zonerefs[nr_zones++]); check_highest_zone(zone_type); } --=20 2.34.1