From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEC6CC433EF for ; Thu, 7 Apr 2022 11:07:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DF266B0073; Thu, 7 Apr 2022 07:07:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48F0A8D0001; Thu, 7 Apr 2022 07:07:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 356216B0075; Thu, 7 Apr 2022 07:07:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 284646B0073 for ; Thu, 7 Apr 2022 07:07:17 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id F2FA361D9B for ; Thu, 7 Apr 2022 11:07:06 +0000 (UTC) X-FDA: 79329806052.09.3BB6C74 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf12.hostedemail.com (Postfix) with ESMTP id 711D940008 for ; Thu, 7 Apr 2022 11:07:06 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 340A621118; Thu, 7 Apr 2022 11:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649329625; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LE2tVt6E1/57kcFgpWdjdBQU6aDSlbFwP46O5S44+90=; b=Tp5lGLf1ElWVIcInGlUGAoJ1sx0YdUjQTq9tC8LzRgATKZFC9iS34ryFP2GTDsBD0Mirv1 vRg/4eIJkZ5rGRuZIS6FxwFEhz62Vaik76t94HU2LQ2QePTUL26rXUg85lWH0KUDm4GPrG NFM/0kDfL93OeH1mpzliJJGkaQkmwQk= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E1E68A3B82; Thu, 7 Apr 2022 11:07:04 +0000 (UTC) Date: Thu, 7 Apr 2022 13:07:04 +0200 From: Michal Hocko To: Juergen Gross Cc: xen-devel@lists.xenproject.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , stable@vger.kernel.org, Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= , Mel Gorman Subject: Re: [PATCH] mm, page_alloc: fix build_zonerefs_node() Message-ID: References: <20220407093221.1090-1-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 711D940008 X-Stat-Signature: cps54ksywkdah6g4m6wqff18xoagpr51 X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Tp5lGLf1; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1649329626-425434 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu 07-04-22 12:45:41, Juergen Gross wrote: > On 07.04.22 12:34, Michal Hocko wrote: > > Ccing Mel > > > > On Thu 07-04-22 11:32:21, Juergen Gross wrote: > > > 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. > > > > What is the actual problem there? > > When running as Xen guest new hotplugged memory will not be onlined > automatically, but only on special request. This is done in order to > support adding e.g. the possibility to use another GB of memory, while > adding only a part of that memory initially. > > In case adding that memory is populating a new zone, the page allocator > won't be able to use this memory when it is onlined, as the zone wasn't > added to the zonelist, due to managed_zone() returning 0. How is that memory onlined? Because "regular" onlining (online_pages()) does rebuild zonelists if their zone hasn't been populated before. -- Michal Hocko SUSE Labs