Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp474355pxk; Wed, 9 Sep 2020 10:05:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwikh6ZFJuxO/A+54jxVYk4zuZZW9DNAuCSdJu5tGyQB6Ivdvjw5v8lXfl3D5kUYTTvMXje X-Received: by 2002:a17:906:11d2:: with SMTP id o18mr4515605eja.420.1599671150599; Wed, 09 Sep 2020 10:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599671150; cv=none; d=google.com; s=arc-20160816; b=FEmLX3utYWvO2ucqC1uQwMiAgew++2hCV9qMzH4wEuui+NodhzXL+CY8zxG6sZYRsd K6Xg+YFJLGAU9ay/jTa7Dcym5ebV1mrUU3IXDZ0irAiV86m+zk2lOn4z4XXGtkZMOFlZ N4KiT901A6IAYAzg9G3raiNZakXTDlBlyx753VLvpOXofcmDfu3hd6CBoCi+1062ty0L wmjLmBgEY+0DJm3iFikwcqw+hXR+t2e7ZCZ9295Cmx1khb761SICsJZ4g3vS14WA2Rus 9Td8soMrCy1euR12sNHuIH3YYKYI5mQqcR0Vbe1hx/rcByQsMvVyKBbFQpbq+SPiNqDh N4Ug== 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; bh=wBCv8+zRgLxz/5A3GQwLq3m9/5E7bq4Py4SfUD9pRMQ=; b=qCT6S3YpYEvxgNGLEI4A2YHbDJcJqt23RysEVLkXZ8UIOs0At5vYwigcVE9WDe/IUH sYPAiWkEkJngWtziogZLwRFabcRJ50hMTXbAJMAU6tFCVvkLe7u3VxkFQ+is8YF9DCRi fFAuqYOj7be2P5jk9kQJKI5BX2eIjx4y2vLC2p6CDSGXMRCGcgGDEOREk3V1CCcnAtat Aw4WL1Q0QSLgdodK98asmVvYI92rg10J6VfJu/VrN3D9+jjE4BfiucM6zt+AQSRXUpdJ gCdn6+VsJVLpNa/pd+LW91v76/rx3JYfDciONey0DkeTU9B2Dcmmtp8nMrwAQucqCw22 T5jA== 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 a2si1817447edf.578.2020.09.09.10.05.27; Wed, 09 Sep 2020 10:05:50 -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 S1731261AbgIIRE5 (ORCPT + 99 others); Wed, 9 Sep 2020 13:04:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:53026 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730432AbgIIPnp (ORCPT ); Wed, 9 Sep 2020 11:43:45 -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 E6EF7AD18; Wed, 9 Sep 2020 12:45:40 +0000 (UTC) Date: Wed, 9 Sep 2020 14:45:24 +0200 From: Michal Hocko To: David Hildenbrand Cc: Greg Kroah-Hartman , Laurent Dufour , 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: <20200909124524.GJ7348@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> <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 09-09-20 14:32:57, 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? > > (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) VM_WARN* is not that much different from panic on warn. Still one can argue that many workloads enable it just because. And I would disagree that we should care much about those because those are debugging features and everybody has to take consequences. On the other hand the question is whether WARN is giving us much. So what is the advantage over a simple pr_err? We will get a backtrace. Interesting but not really that useful because there are only few code paths this can trigger from. Registers dump? Not really useful here. Taint flag, probably useful because follow up problems might give us a hint that this might be related. People tend to pay more attention to WARN splat than a single line error. Well, not really a strong reason, I would say. So while I wouldn't argue against WARN* in general (just because somebody might be setting the system to panic), I would also think of how much useful the splat is. -- Michal Hocko SUSE Labs