Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2720396pxb; Thu, 3 Feb 2022 12:43:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLNzFY8wBopVfStOsetBxuTh7EWde53kCNXuNUACMEsAuSxnDwlDf6x9qHXPeJzdtP68PD X-Received: by 2002:a05:6402:42c6:: with SMTP id i6mr37436308edc.220.1643920985125; Thu, 03 Feb 2022 12:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643920985; cv=none; d=google.com; s=arc-20160816; b=lyhEvlBLT5uAY4G+QOynHBzHI2hsl4MW220cy33RFoGuJHP+JXzVN9Kkeh1BvgYByh RZmZORpWbERyrB+z3bhJzNn4C8plcoR+OSVXQjTDWlFYHJDEH9cxGpOeYQ9VewwD/IhL PyQSm+FIOyZOPkzwmWVbQCDZ2qTLwv19iG4l/Q0H4Nc8vjJvyU/Jc+7uMSCdHYDh8TwG 7rBp1Q1HkDJzlr9S8F9gDF+Lemx6TdKBQ6W8rbZgB2T4X7MR5Lw73uqjFG+yswA1R4/C 5av3s+keLNhCQIsLfsl4RUjZhRt1qCUSiMe4dtFFmwjnel5WU9kTnc69LdkTa1dlJ7tf 3+2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QYpOSBzqXoi3ylme2YRtCDn1ikPZUYmP1IMgv5zMfBQ=; b=Jv+DN3s4yYUlcRTFgIgUedhn6P8lkWYqfiMsqNAAoQxfluDKxxa2NUZ+A8sAmc/Lum Z0Q+5R19TH+BvpoIPwQkPEPyNQZw1/Ab04CWEISc2sj51AI5qri7RRussSQCLPQZa24t q1VC+SL3EVxluvDpEM3jOlahrG7GSqZy3TPa9I2jVbT9NOxs0EKbmpMbdhipRkA9mXuJ vfrzlvMuvcw+oEkU87HYEzQdyRkj8r6gvTWD8HrWg7gReEQ7Ov/46VdGgFzpfRGuo1IM 5P6tbm4X7db35CtTE54a3yYLkN07SzG1Gu/7hFWm/R0/M5UKguVsDuPF1Txiq5Hn4+EV A4WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mSXA2svO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs13si7579389ejc.270.2022.02.03.12.42.39; Thu, 03 Feb 2022 12:43:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mSXA2svO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347266AbiBCJ1O (ORCPT + 99 others); Thu, 3 Feb 2022 04:27:14 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:59382 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230204AbiBCJ1N (ORCPT ); Thu, 3 Feb 2022 04:27:13 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 890311F3A8; Thu, 3 Feb 2022 09:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643880432; 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=QYpOSBzqXoi3ylme2YRtCDn1ikPZUYmP1IMgv5zMfBQ=; b=mSXA2svOe7ddYNz4iRKiBGqV99nGOOaf/5o6RsBRYvSyqPoiLiCetie4I93Iz0+TeDyCkc vso2vIHz/LqQPPx71qFDKZlK0P5LYplTv7WB88HImDadR4j+YPoi0b/SznVUqI+K/F+tr8 DqUJW6PMV6pfbObEY04r4lRvePrKrZ8= 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 D3C72A3B84; Thu, 3 Feb 2022 09:27:11 +0000 (UTC) Date: Thu, 3 Feb 2022 10:27:11 +0100 From: Michal Hocko To: Wei Yang Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand Subject: Re: [PATCH] mm/page_alloc: add zone to zonelist if populated Message-ID: References: <20220203020022.3044-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220203020022.3044-1-richard.weiyang@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 03-02-22 02:00:22, Wei Yang wrote: > During memory hotplug, when online/offline a zone, we need to rebuild > the zonelist for all nodes. Current behavior would lose a valid zone in > zonelist since only pick up managed_zone. > > There are two cases for a zone with memory but still !managed. > > * all pages were allocated via memblock > * all pages were taken by ballooning / virtio-mem > > This state maybe temporary, since both of them may release some memory. > Then it end up with a managed zone not in zonelist. > > This is introduced in 'commit 6aa303defb74 ("mm, vmscan: only allocate > and reclaim from zones with pages managed by the buddy allocator")'. > This patch restore the behavior. It has been introduced to fix a problem described in the the changelog (FADUMP configuration making kswapd hogging a cpu). You are not explaining why the original issue is not possible after this change. I also think that this is more of theoretical issue than anything that is a real life concern. It is good to state that in the changelog as well. That being said I am not against the change but the changelog needs more explanation before I can ack it. > Signed-off-by: Wei Yang > CC: Mel Gorman > CC: David Hildenbrand > Fixes: 6aa303defb74 ("mm, vmscan: only allocate and reclaim from zones with pages managed by the buddy allocator") Fixes tag should be really used only if the referenced commit breaks something. I do not really see this to be the case here. Thanks! > --- > 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 de15021a2887..b433a57ee76f 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -6092,7 +6092,7 @@ static int build_zonerefs_node(pg_data_t *pgdat, struct zoneref *zonerefs) > do { > zone_type--; > zone = 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); > } > -- > 2.33.1 -- Michal Hocko SUSE Labs