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 31049C433EF for ; Sun, 6 Feb 2022 02:17:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC38D6B00A6; Sat, 5 Feb 2022 21:17:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A731D6B00A7; Sat, 5 Feb 2022 21:17:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EDAD6B00A8; Sat, 5 Feb 2022 21:17:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id 7A90E6B00A6 for ; Sat, 5 Feb 2022 21:17:29 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1DFE88F86B for ; Sun, 6 Feb 2022 02:17:29 +0000 (UTC) X-FDA: 79110743418.27.B8028A8 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by imf01.hostedemail.com (Postfix) with ESMTP id A718C40004 for ; Sun, 6 Feb 2022 02:17:28 +0000 (UTC) Received: by mail-ej1-f53.google.com with SMTP id j14so8043569ejy.6 for ; Sat, 05 Feb 2022 18:17:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Wvf9x00J4H0W2AQG3OJGkAg6nkvU0MOU4LOi8pHnx4M=; b=OsK0qtG1h0KYp7kPZzPff4dCLuuOUfjvFIuPL+0sKkUosvSwxXX1VDwYE0RawoQ0Oz kVQxlHNdJ+y8wqGO3RX1dxSSqEVrKDC/ydHCvOk17/JTWoLKo16KlZGhBm2ELtJhIyPV d54TErKu+o0RjoadLyMnW8A8hy6+hVO5/a9VjLjqQtfrRj55Qe3HTJwVFsKtnXMdX7sV eRDIZ5HA/5wSI0WC1Llmi9XMO4nF09j9i1iu/qudQRwnbUf1Ysxh4G5N4kfjbAyg8I2b FDbFxxdYTv6dBFqp76VLyTByubPiDZNEOH7RKN+b+xju0VRwfAs/221Syz6moSbQ6J9D 4OZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Wvf9x00J4H0W2AQG3OJGkAg6nkvU0MOU4LOi8pHnx4M=; b=0yWuFxyT/XsdZSrBd+UvxCbw89ok2ypDgojyVvJ6UFbDSW37oGahmNQBWiiwMSB1Mi bhtZPeoRLmxe9AEi/PMVwZ37vvjorl7ZiUIjZz4/e/tWagDKOsc6+zbh9OssHp8n1SpQ 5qToWv2nC+DWhZ+vKYeZP8uaJLvvkxzumAcTdZND3ZOC3BVaZx7AvHCG6Cj/zevlzv6H tpfwgzjMD4jtGg+dS54E6rH1ABC5BgAw4IoK40wcsOwHXpPGvk529+cXuajpr6pYFvf1 7rg/gWa5Ir+aEXiF8ngWgUwfTgh2/Ku6sHEFeHhT56jZ9kvv1OVTFP7+QcUUJ5EsrLmf t5GQ== X-Gm-Message-State: AOAM532ftrEM5FZFXaItJ5rSpsj8kaK6wy3Wbs2Ic1aXZ9SwjYbgVjdZ TYh3+/DhyKcgZdjAwCjnhCc= X-Google-Smtp-Source: ABdhPJwTFYukW4RrmUsK/ddV16Y1VVdSTCQC1gnIaHfwCDOH9sqGCiEpWdfcdpRK+vZLOfUtRZv7YA== X-Received: by 2002:a17:907:2da0:: with SMTP id gt32mr4744761ejc.545.1644113847273; Sat, 05 Feb 2022 18:17:27 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id dt15sm2128704ejb.190.2022.02.05.18.17.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Feb 2022 18:17:26 -0800 (PST) Date: Sun, 6 Feb 2022 02:17:26 +0000 From: Wei Yang To: Michal Hocko Cc: Wei Yang , 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: <20220206021726.wknhhvkc7fevkpc4@master> Reply-To: Wei Yang 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: User-Agent: NeoMutt/20170113 (1.7.2) X-Rspamd-Queue-Id: A718C40004 X-Rspam-User: nil Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OsK0qtG1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com X-Stat-Signature: ci3okq3qsdoj1s49m7mrnjur9fchtxjc X-Rspamd-Server: rspam08 X-HE-Tag: 1644113848-309892 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, Feb 03, 2022 at 10:27:11AM +0100, Michal Hocko wrote: >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. > The first sight is kswapd deals with pgdat->node_zones, which is not affected by pgdat->node_zonelists. For the exact detail, I don't figure that out now. Will need some time to take a look into. For that commit, I only found this link. http://lkml.kernel.org/r/20160831195104.GB8119@techsingularity.net If there are some other discussions, it would be helpful. >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. > Got it. >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 -- Wei Yang Help you, Help me