linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: David Hildenbrand <david@redhat.com>
Cc: qiwuchen55@gmail.com, akpm@linux-foundation.org,
	willy@infradead.org, richard.weiyang@gmail.com,
	pankaj.gupta.linux@gmail.com, yang.shi@linux.alibaba.com,
	cai@lca.pw, bhe@redhat.com, linux-mm@kvack.org,
	chenqiwu <chenqiwu@xiaomi.com>
Subject: Re: [PATCH] mm: use VM_BUG_ON*() helpers to dump more debugging info
Date: Mon, 6 Apr 2020 09:54:25 +0200	[thread overview]
Message-ID: <20200406075425.GJ19426@dhcp22.suse.cz> (raw)
In-Reply-To: <70055cf8-165f-9e64-045d-617f02bdde9a@redhat.com>

On Mon 06-04-20 09:40:05, David Hildenbrand wrote:
> On 06.04.20 05:55, qiwuchen55@gmail.com wrote:
> > From: chenqiwu <chenqiwu@xiaomi.com>
> > 
> > This patch use VM_BUG_ON*() helpers instead of simple BUG_ON()
> > in some of the main mm codes. If CONFIG_DEBUG_VM is set, we can
> > get more debugging information when the bug is hit.
> > 
> 
> The "issue" in this context of VM_BUG_ON*() is that, without
> CONFIG_DEBUG_VM,  there won't really be any runtime checks anymore,
> meaning a production system would not stop and BUG_ON() (which would be
> disruptive, but there is a chance to debug this), instead it would
> happily continue to run, eventually messing up something else.
> 
> This is a clear change introduced in this series.
> 
> My gut feeling is that we want to convert this on a per-case basis instead.

This definitely should be done on per-case basis. Many of those bug ons
are historical and they wouldn't be allowed these days. So I would
definitely recommend going through each of them and re-evaluate whether
they are really needed and whether they serve any purpose. A rule of
thumb is that if we can handle the situation more gracefully then the
BUG_ON should be simply dropped. If a verbatim output in a debugging
mode would serve a good purpose then WARN{_ONECE} would serve a good
purpose and if a crash is would help debugging in a DEBUG_VM mode then
use the VM_BUG_ON instead.
-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2020-04-06  7:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06  3:55 qiwuchen55
2020-04-06  7:40 ` David Hildenbrand
2020-04-06  7:54   ` Michal Hocko [this message]

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=20200406075425.GJ19426@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=cai@lca.pw \
    --cc=chenqiwu@xiaomi.com \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=pankaj.gupta.linux@gmail.com \
    --cc=qiwuchen55@gmail.com \
    --cc=richard.weiyang@gmail.com \
    --cc=willy@infradead.org \
    --cc=yang.shi@linux.alibaba.com \
    /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