Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp682267pxb; Tue, 1 Feb 2022 08:16:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUJlSjxajsARgJ3t5xqWCANFzpPuwTMBOqHwjjNU+S2/5CtK35zMRcP6lk4SGMGEcbI5Nf X-Received: by 2002:a17:907:9619:: with SMTP id gb25mr21505259ejc.426.1643732199137; Tue, 01 Feb 2022 08:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643732199; cv=none; d=google.com; s=arc-20160816; b=bIEf8UZ0M5NZLMgo3SAczbyZMvpzrvS3/S6E8nAD9XSVBl3TNcL0Iqaq7CVrVkQrGY RGzcOPxrUqu38ulWK8F0xmbJF+gmDnLF+rPbJLwdb3nZ7e4nFhKy7kjjCklwl1W/jCKg Z0ZKRbUGO71XcI3vFQ6yLB+FqMPBsqXoRCTJAtgV7c/Onk/F8pxP18ljD1M6DmFInvLm tH7nrxKQDyvwWWKjRfb2d8njbZ7y/rXGzAFRkBhSdyj5DSqjN8I96JAlyqX3lKu8Udpl T49KRshl4uwR8nZsvF6u8srepqC/yUNP7FrtWDm9aYNR1PtF6FntUjwBjpe9w186IkGB GctA== 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=0hz3FVY2lD48V2ZTs1+H/0RTN7r8b6FNhKGlpEPpz9E=; b=Vm9FxgPW9hO4i0Wy5xcv3qiUDPQXB9CcFUEshzmrDPwMB2WtFl4jOqEokqqPaI9Ujf BPk8wGkMQSJjXvl8aYuakeeNssWwmtvGla9QfQ2PAewmGSTpIYwxLPRFplSaN8CStNyV NsV3gxCMAhDIeVJ/w6A2vjqQGUiFT1dnlPXzLnmQNS8hyLKW9C61FLPI3JwVE3iEpVzb rJC86PCoaDen8E8mYdD6mjBOtyQVkfa//hqQ4XVgllSnGzSAWanEGeyWVTErbVxEERTD lMST+tM73ySi0nfJIIqLE2VAAtfgSkKQVVLgVIYNewGzl9cEaTsR12NDuP8E/U6yOehO fYIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=i6Qyz0PT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf27si9629663edb.387.2022.02.01.08.16.12; Tue, 01 Feb 2022 08:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=i6Qyz0PT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S244172AbiAaKZU (ORCPT + 99 others); Mon, 31 Jan 2022 05:25:20 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:33454 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239964AbiAaKYw (ORCPT ); Mon, 31 Jan 2022 05:24:52 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 46283210FF; Mon, 31 Jan 2022 10:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643624690; 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=0hz3FVY2lD48V2ZTs1+H/0RTN7r8b6FNhKGlpEPpz9E=; b=i6Qyz0PTXKJ3XKNRimsaM9gR6PIQS+yhAtKrfdOLffZRt63ky/wDOUXpvLJsEXA217lcIS jAsuj/sR2a19yrcKUCNU7tJoepMREw9nkQ762UfdlPjCHsgaytbDrx9icLfWC/W8wf3bBB HLbCfi//fWOOk841kUiKI7xoS4K7qKs= 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 7D597A3B83; Mon, 31 Jan 2022 10:24:49 +0000 (UTC) Date: Mon, 31 Jan 2022 11:24:48 +0100 From: Michal Hocko To: Wei Yang Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/memory_hotplug: build zonelist for managed_zone Message-ID: References: <20220127012023.18095-1-richard.weiyang@gmail.com> <20220129002628.2cwr35glahq5f5md@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220129002628.2cwr35glahq5f5md@master> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 29-01-22 00:26:28, Wei Yang wrote: > On Thu, Jan 27, 2022 at 09:28:17AM +0100, Michal Hocko wrote: > >On Thu 27-01-22 01:20:23, Wei Yang wrote: > >> During memory hotplug, when online/offline a zone, we need to rebuild > >> the zonelist for all node. There are two checks to decide whether a zone > >> would be added to zonelist: > >> > >> * one in online_pages/offline_pages to decide necessity > >> * one in build_zonerefs_node to do real add > >> > >> Currently we use different criteria at these two places, which is > >> different from the original behavior. > >> > >> Originally during memory hotplug, zonelist is re-built when zone hasn't > >> been populated. This in introduced in 'commit 6811378e7d8b ("[PATCH] > >> wait_table and zonelist initializing for memory hotadd: update zonelists")'. > >> And at that moment, build_zonelists_node() also use populated_zone() to > >> decide whether the zone should be added to zonelist. > >> > >> While in 'commit 6aa303defb74 ("mm, vmscan: only allocate and reclaim > >> from zones with pages managed by the buddy allocator")', > >> build_zonelists_node() changed to use managed_zone() to add zonelist. > >> But we still use populated_zone() to decide the necessity. > >> > >> This patch restore the original behavior by using the same criteria to > >> add a zone in zonelist during memory hotplug. > > > >Why? > > > > In case we online a populated zone, but not managed. Then this zone will not > be in zonelist. Right? yeah. We can theoretically end up with a zone without any managed menory on the zonelists. But my primary question is why do we need this change? Does it fix any existing problem? Does it make the code easier to read/understand? Does it improve performance? Every patch should have a justification. Your changelog merely lists the history and then states the new behavior without any explanation of why that is needed or desired. See? -- Michal Hocko SUSE Labs