linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <songmuchun@bytedance.com>,
	Roman Gushchin <guro@fb.com>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	 Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [External] Re: [PATCH v2] mm: memcontrol: fix kernel stack account
Date: Wed, 3 Mar 2021 06:42:11 -0800	[thread overview]
Message-ID: <CALvZod7LLP02bw0t0eJFz1CF6dannFDNEGY2dNWOdqzqmJ_jEg@mail.gmail.com> (raw)
In-Reply-To: <YD+XB6LVUhwL6qm+@dhcp22.suse.cz>

On Wed, Mar 3, 2021 at 6:02 AM Michal Hocko <mhocko@suse.com> wrote:
>
[...]
> > > > +             BUG_ON(vm->nr_pages != THREAD_SIZE / PAGE_SIZE);
> > >
> > > I do not think we need this BUG_ON. What kind of purpose does it serve?
> >
> > vm->nr_pages should be always equal to THREAD_SIZE / PAGE_SIZE
> > if the system is not corrupted.
>
> BUG_ON is not an annotation for "this shouldn't happen". Even if the
> system was corrupted and nr_pages wouldn't match then this is not a
> reason to crash the kernel right away.
>
> In general there should be a very _strong_ reason to add a BUG_ON.
>

I agree with Michal. We should remove this BUG_ON or at least convert
it into VM_BUG_ON.


  reply	other threads:[~2021-03-03 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03  9:39 [PATCH v2] mm: memcontrol: fix kernel stack account Muchun Song
2021-03-03 10:25 ` Michal Hocko
2021-03-03 13:27   ` [External] " Muchun Song
2021-03-03 14:02     ` Michal Hocko
2021-03-03 14:42       ` Shakeel Butt [this message]
2021-03-03 15:14 ` Johannes Weiner

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=CALvZod7LLP02bw0t0eJFz1CF6dannFDNEGY2dNWOdqzqmJ_jEg@mail.gmail.com \
    --to=shakeelb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=songmuchun@bytedance.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;
as well as URLs for NNTP newsgroup(s).