Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp992044pxk; Thu, 10 Sep 2020 04:22:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUTJoR/tsN7wJXrNaJSGefkgElXtSJT6rWmC4XlFDfoYKtnNcGiPKNSpQahPV21M7zmxfw X-Received: by 2002:a17:906:e08f:: with SMTP id gh15mr8001957ejb.443.1599736940953; Thu, 10 Sep 2020 04:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599736940; cv=none; d=google.com; s=arc-20160816; b=mBST9BJIdolpFoii+IndIxNssYGjs2iZXTHhHdjLvegmTy7ZgchJ0Cx6KDr5Xlkwnt jtZUUK2qHTkIAx6NpMps3M9DpfYjYjE1jOFmye0RzLJ526rwX6CL0DQk77xdYfZHTiHa 7OVftVZJbFtDcNzSuehN4rv74fhrFLP146y92eTwGRjUpuTIMUrhwBNWyPCnX2PrFHbX GC6Fj3VCllbzjHP4eKjMpPDI5aAWgx88TKTZKTcR4SUE4XVRmVmPjyAu8B2yPCpLM4Fl ZXMpSmdiGM5WAc8tlJnj77NnGrQGeW8FQ5CGsZHQ4mNaEEHiI/OGzNdNzfckI016ioRw ukcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cw5jUgVGJN6TY0iPmk0Fd+O8htnVSNR3byOWnKOqRvo=; b=g+o08uzErXZTD5vqPai1VVMMC6XahW0Vc4xF6/DAnhlT3iuK0r47UFcuQRr+EZFnR9 IEqIjmkTfUKusclUwCp+LfBuO9ugeckVe3WiY6DB54S+g5LN0dZ4OYKjNAJyTWAACxAB PzeJsB90Tg6d8pjO22Nm1AQy1uSU6hUK94XM6PWl1qotIHwc35/3PbGaU2M5s3vMXqbQ ql47Jd+WkQtw3/Vqgfv9Sy1z+aCNias41Yn99RB8U5ODL4VvU0aRFofmlWLHd1YuEF3I /FWzQvIzw5xIa2dVXZQjGx8Vm7AUFBfcuMLfBw6CS1ORdS+jlLO1B8S8mf5n42bywmQL DeCQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si3318921eje.20.2020.09.10.04.21.57; Thu, 10 Sep 2020 04:22:20 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730206AbgIJLQq (ORCPT + 99 others); Thu, 10 Sep 2020 07:16:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:47476 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730255AbgIJLNn (ORCPT ); Thu, 10 Sep 2020 07:13:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D08DFABB2; Thu, 10 Sep 2020 11:13:02 +0000 (UTC) Date: Thu, 10 Sep 2020 13:12:46 +0200 From: Michal Hocko To: Laurent Dufour Cc: akpm@linux-foundation.org, David Hildenbrand , Oscar Salvador , rafael@kernel.org, nathanl@linux.ibm.com, cheloha@linux.ibm.com, stable@vger.kernel.org, Greg Kroah-Hartman , linux-mm@kvack.org, LKML Subject: Re: [PATCH] mm: don't rely on system state to detect hot-plug operations Message-ID: <20200910111246.GE28354@dhcp22.suse.cz> References: <5cbd92e1-c00a-4253-0119-c872bfa0f2bc@redhat.com> <20200908170835.85440-1-ldufour@linux.ibm.com> <20200909074011.GD7348@dhcp22.suse.cz> <9faac1ce-c02d-7dbc-f79a-4aaaa5a73d28@linux.ibm.com> <20200909090953.GE7348@dhcp22.suse.cz> <4cdb54be-1a92-4ba4-6fee-3b415f3468a9@linux.ibm.com> <20200909105914.GF7348@dhcp22.suse.cz> <74a62b00-235e-7deb-2814-f3b240fea25e@linux.ibm.com> <20200910072331.GB28354@dhcp22.suse.cz> <31cfdf35-618f-6f56-ef16-0d999682ad02@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <31cfdf35-618f-6f56-ef16-0d999682ad02@linux.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 10-09-20 09:51:39, Laurent Dufour wrote: > Le 10/09/2020 ? 09:23, Michal Hocko a ?crit?: > > On Wed 09-09-20 18:07:15, Laurent Dufour wrote: > > > Le 09/09/2020 ? 12:59, Michal Hocko a ?crit?: > > > > On Wed 09-09-20 11:21:58, Laurent Dufour wrote: > > [...] > > > > > For the point a, using the enum allows to know in > > > > > register_mem_sect_under_node() if the link operation is due to a hotplug > > > > > operation or done at boot time. > > > > > > > > Yes, but let me repeat. We have a mess here and different paths check > > > > for the very same condition by different ways. We need to unify those. > > > > > > What are you suggesting to unify these checks (using a MP_* enum as > > > suggested by David, something else)? > > > > We do have system_state check spread at different places. I would use > > this one and wrap it behind a helper. Or have I missed any reason why > > that wouldn't work for this case? > > That would not work in that case because memory can be hot-added at the > SYSTEM_SCHEDULING system state and the regular memory is also registered at > that system state too. So system state is not enough to discriminate between > the both. If that is really the case all other places need a fix as well. Btw. could you be more specific about memory hotplug during early boot? How that happens? I am only aware of https://lkml.kernel.org/r/20200818110046.6664-1-osalvador@suse.de and that doesn't happen as early as SYSTEM_SCHEDULING. -- Michal Hocko SUSE Labs