Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp294594pxk; Wed, 9 Sep 2020 05:42:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxaECOYqQg/9SmeQsyoO6ZjH3zl/KS+V4VLxVlCJcLXxP1vFkjZ3aqd79mQUqeO4cAz/AZ X-Received: by 2002:a05:6402:1544:: with SMTP id p4mr3820368edx.346.1599655360541; Wed, 09 Sep 2020 05:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599655360; cv=none; d=google.com; s=arc-20160816; b=fFq+udhEC2zY2dODpMO9MN2bo6ZYE4Oq/K0w19uUAqfcEPuYmc9ImiD5UoUl5dBaE3 fcKHAw5/biQZdDn207b/8alYcebYyH3nZsntQ/C61twrppjplyTZqfZnOVyqJPN5zJ1U /1uPApsM0BROcuaXgolWsxUK8dKFE/NM3vYMQFLPYF2aruqEzP/MDbpwhN+mym54B29s O/Szqo2ktZplOkgcsMFP5ccNT6tIbA2kJz0xsF+XSj/7a5WVMD4qp5UXcPM8fY1cvVCY yUm1fTeK/PhpfyXonZKhTIL/4UA6rCwZ6MhhoKoENCJDo0dRHcuAtcOPbXMMwB3wqsFz ROYg== 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=4SrMpFLFstRjeSwjmGrdgjFNmSBpgZ0s+Ig/vn9+YUo=; b=tzUmf0drWJ5BAV/mB7BWE9dVtru5AndnNvZAv7ZUFPj8Hg4i8WJp5KqUrUCnbSpjLD PhjYQQnHrhOyHFDH5JrIy6KuGxmu6GZqr8Gx56aThkBlbhG/ChNBkWhoO8+gPJQ/5qFC bjlZqjMgz1BQBRVeoUiQhPAQlF6b9bvPcFa0Veu+WnnoO3R+4LnRI6RifkVQiXNAnXc/ h/tlfrxq8aTJgp8bQ9jfpkw2w0jxRCLKeC6LDl+lV1OgrO0qbhfqigv5hb/gjULY918m wjMZap8zi+U4q4JIh+BuegIODQsGCiMRfYqOu4Ia0qr3L7DWEDWx1IO7JV7CUl5hbq+B 3Mlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XN1JLSjx; 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 s22si1295835edc.481.2020.09.09.05.42.17; Wed, 09 Sep 2020 05:42:40 -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=XN1JLSjx; 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 S1727804AbgIIMhV (ORCPT + 99 others); Wed, 9 Sep 2020 08:37:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:32920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730030AbgIIMae (ORCPT ); Wed, 9 Sep 2020 08:30:34 -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 E0D0321D93; Wed, 9 Sep 2020 12:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599654591; bh=kLzIbSajdRz1W80PzG78m/ukaUR6VgdyxOemY3uuv9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XN1JLSjxX3db+1p0W9RYsRlQf4MqjgINmFg8dNg6De2EpU8/rLho7nnPFUQL3/bhs HaUn5avZLdYnGTOzc/XwLBALpYkHBCOm5SDTmUg0Z/saMCr8AguCOwFjMhtiwROwir F7bHFc4TnVjoLe4AO9CKYFvgTrBgp57hEi7rzq6U= Date: Wed, 9 Sep 2020 14:30:01 +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: <20200909123001.GA670250@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ad553f2-ebbf-cae5-5570-f60d2c965c41@redhat.com> 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 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. thanks, greg k-h