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 A2648C433EF for ; Thu, 7 Apr 2022 22:45:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D2288D0006; Thu, 7 Apr 2022 18:44:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 87FC46B0074; Thu, 7 Apr 2022 18:44:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7209A8D0006; Thu, 7 Apr 2022 18:44:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 634896B0073 for ; Thu, 7 Apr 2022 18:44:41 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3189625D07 for ; Thu, 7 Apr 2022 22:44:31 +0000 (UTC) X-FDA: 79331563542.12.CEB435A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf05.hostedemail.com (Postfix) with ESMTP id A4B0C100005 for ; Thu, 7 Apr 2022 22:44:30 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B7E8BB82816; Thu, 7 Apr 2022 22:44:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4757EC385A4; Thu, 7 Apr 2022 22:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1649371467; bh=hIvqS6RVxt92RR7xvo4WKRMmb/Y56ZN8tL5vx0hkAGs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HM77SMATfGFl5LMW36PL6MtnIJvmB/XAW+fcPCI29k5nWhVpuUTY3HzmBNmIqdg3v uP48N1JWMBDzHVnrKsuoXOsc22VHVDUHOfbrW1ak0p4vMB9ounTiSYUk6QPs7aeNlq SzxKfbBfdjsvz1qfo0G3dGVoLZu5FtkwlT9+a+ME= Date: Thu, 7 Apr 2022 15:44:26 -0700 From: Andrew Morton To: Juergen Gross Cc: xen-devel@lists.xenproject.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Marek =?ISO-8859-1?Q?Marczykowski-G=F3recki?= , Michal Hocko Subject: Re: [PATCH v2] mm, page_alloc: fix build_zonerefs_node() Message-Id: <20220407154426.7076e19f5b80d927dd715de9@linux-foundation.org> In-Reply-To: <20220407120637.9035-1-jgross@suse.com> References: <20220407120637.9035-1-jgross@suse.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A4B0C100005 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=HM77SMAT; dmarc=none; spf=pass (imf05.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: ssmqndmhxbjihx4pbc57rum5yei5ix9k X-HE-Tag: 1649371470-26695 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, 7 Apr 2022 14:06:37 +0200 Juergen Gross wrote: > Since commit 6aa303defb74 ("mm, vmscan: only allocate and reclaim from > zones with pages managed by the buddy allocator") Six years ago! > 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 when zonelists are being > rebuilt. > > The decision whether to rebuild the zonelists when onlining new memory > is done based on populated_zone() returning 0 for the zone the memory > will be added to. The new zone is added to the zonelists only, if it > has free memory pages (managed_zone() returns a non-zero value) after > the memory has been onlined. This implies, that onlining memory will > always free the added pages to the allocator immediately, but this is > not true in all cases: when e.g. running as a Xen guest the onlined > new memory will be added only to the ballooned memory list, it will be > freed only when the guest is being ballooned up afterwards. > > Another problem with using managed_zone() for the decision whether a > zone is being added to the zonelists is, that a zone with all memory > used will in fact be removed from all zonelists in case the zonelists > happen to be rebuilt. > > Use populated_zone() when building a zonelist as it has been done > before that commit. > > Cc: stable@vger.kernel.org Some details, please. Is this really serious enough to warrant backporting? Is some new workload/usage pattern causing people to hit this?