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 53E89C433EF for ; Thu, 7 Apr 2022 11:48:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFE5D6B0071; Thu, 7 Apr 2022 07:48:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAE366B0073; Thu, 7 Apr 2022 07:48:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9DB46B0074; Thu, 7 Apr 2022 07:48:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id BC9006B0071 for ; Thu, 7 Apr 2022 07:48:22 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7D5EB183C8AA0 for ; Thu, 7 Apr 2022 11:48:12 +0000 (UTC) X-FDA: 79329909624.28.4EE51BD Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf21.hostedemail.com (Postfix) with ESMTP id CF3C91C0002 for ; Thu, 7 Apr 2022 11:48:11 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A5A361F859; Thu, 7 Apr 2022 11:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649332090; 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=hzzsqE3lHhZNTb0uSMaOKkro2CJhyy2oCUvOJqbqZYE=; b=LRhI4GBAtx/ASTu7jlVvYU6iX4vVt2LFIwag927OFBVZh0Lr1jMIOfEGw9c9SxZNVzFQha xg7kb97zo3WZEJKBe2Wv6WIhoduV9gMh9VFa634GDpd0fIs7PH2Z4rZb+cA1AixjYxlkAm hEI1iPyd5PLXUAREH5GDnfoMbvX/Fgk= 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 74176A3B88; Thu, 7 Apr 2022 11:48:10 +0000 (UTC) Date: Thu, 7 Apr 2022 13:48:09 +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> <5e97a7f5-1fc9-d0b4-006e-6894d5653c06@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=LRhI4GBA; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Stat-Signature: 4roopo71xs5uswnmjqbqx3b6o34xd5wx X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: CF3C91C0002 X-HE-Tag: 1649332091-794137 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 13:40:25, Michal Hocko wrote: [...] > Now to your patch. I suspect this is not sufficient for the full hotplug > situation. Consider a new NUMA node to be hotadded. hotadd_new_pgdat > will call build_all_zonelists but the zone is not populated yet at that > moment unless I am missing something. We do rely on online_pages to > rebuild once pages are onlined - which usually means they are freed to > the page allocator. OK, I've managed to get lost in the code and misread the onlining part. After re-reading the code I have concluded that the patch is good as is. online_pages relies on zone_populated so it will pass and zonelists will be regenerated even without any pages freed to the allocator. Sorry for the confusion. But I guess this still proves my other point that the code is really subtle and messy so I guess the less rebuilding we do the better. There are two ways, go with your patch and do the clean up on top or merge the two. That being said Acked-by: Michal Hocko to your patch with an improved changelog to be more specific about the underlying problem. Thanks and sorry for the confusion. -- Michal Hocko SUSE Labs