Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp301158pxk; Wed, 9 Sep 2020 05:55:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSnu4GQk4iiO5dGtpEE2Op0UtFdU+S7rYUZCl2fPSS41lkxj4b9p8xisAMNFSSMw7o241q X-Received: by 2002:a50:d54b:: with SMTP id f11mr3840987edj.329.1599656106734; Wed, 09 Sep 2020 05:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599656106; cv=none; d=google.com; s=arc-20160816; b=JvGiMD6xYicRgjG75a4TBr4//GPRljYqT8DfIVA/PpHR32OnKHQKREqjestIwdov83 mRAb1gcxKgcvH2MWe4ylLsihBQ4RXv+Nk1SyOGFXtHryc1WEAPNmYaWPman4/UXYYY4l FSa1fNbj+aS2zFZxmnQYxinFm2nXx9lMI4Pw9SlEZXWBQM5K9aHBGK4DB5mOi47Yh/3l KHhwPDLmrlgIrVMtl2hDru/C6TRRA3dQzgBONGhuEWLrGBeIScDVemuqxle9S+eItAnX ZGextgmC/jhGOzMA/X+PLZxtRqGtJWPVav7bg0Qk+JrYCwhqP+kwXBXZOrvCXWrv3kE8 QAsQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=024re00d4miX7fuUpEzNEh0prq3UubEyjYa8eUJnEus=; b=SMGEIyHN+kWvrp4q1o7R+7VsEvea6JUzhTAHZExkPjQ2JqpiM5te+lHKMXxj8Xxb49 RJru95261rWx1qYPPcwDXdn5+Rrlmi7aDE7lmWJ1clI4PWqNbyjCWh2p4vN3vMdfbru8 Ux6rigDp2f33DYFAwYIHHtVVfm4FgZpk3VUjK0DynwvNVUdb628OMVcRCGC7WyCplhpE tWnwPAE+9ezXmzOPMVMEA4cOGng89o7xNIPdeUIJbB30P/3zRDVvoW5QS/+yMf/BbLzA 2sZstp0Rng+YJX2n5SvTg2iYiH9x1dsa4SkhgPA9BwvPxDzVkpniAYN05B5addfPT/9O FPdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C19O5ED9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si1390198ejg.435.2020.09.09.05.54.44; Wed, 09 Sep 2020 05:55:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=C19O5ED9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725974AbgIIMwj (ORCPT + 99 others); Wed, 9 Sep 2020 08:52:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730239AbgIIMhp (ORCPT ); Wed, 9 Sep 2020 08:37:45 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 40C8421941; Wed, 9 Sep 2020 12:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599654987; bh=MyTxeMGJ0aUch6xrrUFEzK1mWKVG/hL4CJaX7/Slcb4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C19O5ED9pwEGaBq3WjWQS4SEZ5Lwz/9O2+IjIPFpWqNr+we1f2lRLe54jer5JqlNM 0eSNjuQLOcEhFYhT4ftwMDXBld7PGwh/f/JVfvv+XZE6TQig928vZxQqqZDRZPZQsc zPOFUH1l4t7YyS3kNcaMlIRHQgbQ9Wd+oQufliok= Date: Wed, 9 Sep 2020 14:36:37 +0200 From: Greg Kroah-Hartman To: David Hildenbrand Cc: Laurent Dufour , Michal Hocko , akpm@linux-foundation.org, Oscar Salvador , rafael@kernel.org, nathanl@linux.ibm.com, cheloha@linux.ibm.com, stable@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH] mm: don't rely on system state to detect hot-plug operations Message-ID: <20200909123637.GA671204@kroah.com> 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> <9ad553f2-ebbf-cae5-5570-f60d2c965c41@redhat.com> <20200909123001.GA670250@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 02:32:57PM +0200, David Hildenbrand wrote: > On 09.09.20 14:30, Greg Kroah-Hartman wrote: > > On Wed, Sep 09, 2020 at 11:24:24AM +0200, David Hildenbrand wrote: > >>>> I am not sure an enum is going to make the existing situation less > >>>> messy. Sure we somehow have to distinguish boot init and runtime hotplug > >>>> because they have different constrains. I am arguing that a) we should > >>>> have a consistent way to check for those and b) we shouldn't blow up > >>>> easily just because sysfs infrastructure has failed to initialize. > >>> > >>> 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. > >>> > >>> For the point b, one option would be ignore the link error in the case the link > >>> is already existing, but that BUG_ON() had the benefit to highlight the root issue. > >>> > >> > >> WARN_ON_ONCE() would be preferred - not crash the system but still > >> highlight the issue. > > > > Many many systems now run with 'panic on warn' enabled, so that wouldn't > > change much :( > > > > If you can warn, you can properly just print an error message and > > recover from the problem. > > Maybe VM_WARN_ON_ONCE() then to detect this during testing? If you all use that, sure. > (we basically turned WARN_ON_ONCE() useless with 'panic on warn' getting > used in production - behaves like BUG_ON and BUG_ON is frowned upon) Yes we have, but in the end, it's good, those things should be fixed and not accessable by anything a user can trigger. thanks, greg k-h