linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: David Hildenbrand <david@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Laurent Dufour <ldufour@linux.ibm.com>,
	akpm@linux-foundation.org, Oscar Salvador <osalvador@suse.de>,
	rafael@kernel.org, nathanl@linux.ibm.com, cheloha@linux.ibm.com,
	stable@vger.kernel.org, linux-mm@kvack.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: don't rely on system state to detect hot-plug operations
Date: Wed, 9 Sep 2020 14:45:24 +0200	[thread overview]
Message-ID: <20200909124524.GJ7348@dhcp22.suse.cz> (raw)
In-Reply-To: <e3ea2aab-70d5-0da4-7e72-c02051854497@redhat.com>

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

  parent reply	other threads:[~2020-09-09 17:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5cbd92e1-c00a-4253-0119-c872bfa0f2bc@redhat.com>
     [not found] ` <20200908170835.85440-1-ldufour@linux.ibm.com>
2020-09-09  7:40   ` [PATCH] mm: don't rely on system state to detect hot-plug operations Michal Hocko
2020-09-09  7:48     ` Laurent Dufour
2020-09-09  9:09       ` Michal Hocko
2020-09-09  9:21         ` Laurent Dufour
2020-09-09  9:24           ` David Hildenbrand
2020-09-09  9:32             ` Laurent Dufour
2020-09-09 12:30             ` Greg Kroah-Hartman
2020-09-09 12:32               ` David Hildenbrand
2020-09-09 12:36                 ` Greg Kroah-Hartman
2020-09-09 12:45                 ` Michal Hocko [this message]
2020-09-09 10:59           ` Michal Hocko
2020-09-09 16:07             ` Laurent Dufour
2020-09-10  7:23               ` Michal Hocko
2020-09-10  7:51                 ` Laurent Dufour
2020-09-10 11:12                   ` Michal Hocko
2020-09-10 11:35                     ` Laurent Dufour
2020-09-10 12:00                       ` David Hildenbrand
2020-09-10 12:36                         ` Laurent Dufour
2020-09-10 12:38                           ` David Hildenbrand
2020-09-10 12:01                       ` Michal Hocko
2020-09-10 12:03                       ` Oscar Salvador
2020-09-10 12:32                         ` Laurent Dufour
2020-09-10 12:47                         ` Michal Hocko
2020-09-10 12:48                           ` Michal Hocko
2020-09-10 13:39                             ` Oscar Salvador
2020-09-10 13:51                               ` Michal Hocko
2020-09-10 14:40                                 ` Michal Hocko
2020-09-10 12:49                           ` David Hildenbrand
2020-09-10 13:54                             ` Michal Hocko
2020-09-10 13:57                               ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200909124524.GJ7348@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=cheloha@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ldufour@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nathanl@linux.ibm.com \
    --cc=osalvador@suse.de \
    --cc=rafael@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).