linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, David Hildenbrand <david@redhat.com>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH] mm: implement "memory.oops_if_bad_pte=1" boot option
Date: Thu, 10 Jul 2025 19:47:47 +0300	[thread overview]
Message-ID: <1e49cfaf-4669-4b59-afdb-cc872dbcc950@p183> (raw)
In-Reply-To: <df9c25ac-c290-4c65-ac70-729cddf2aee4@suse.cz>

On Thu, Jul 10, 2025 at 09:35:41AM +0200, Vlastimil Babka wrote:
> On 7/9/25 20:10, Alexey Dobriyan wrote:
> > Implement
> > 
> > 	memory.oops_if_bad_pte=1
> > 
> > boot option which oopses the machine instead of dreadful
> > 
> > 	BUG: Bad page map in process
> > 
> > message.
> > 
> > This is intended
> > for people who want to panic at the slightest provocation and
> > for people who ruled out hardware problems which in turn means that
> > delaying vmcore collection is counter-productive.
> > 
> > Linux doesn't (never?) panicked on PTE corruption and even implemented
> > ratelimited version of the message meaning it can go for minutes and
> > even hours without anyone noticing which is exactly the opposite of what
> > should be done to facilitate debugging.
> > 
> > Not enabled by default.
> > 
> > Not advertised.
> > 
> > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> 
> Could we just reuse the existing panic_on_oops? Would anyone want to panic
> in this particular without the others, or vice versa?

Yes, it is supposed to be used with panic_on_oops=1, otherwise lot of
innocent processes might die.

I'll rerhrase the comment.

> > +/*
> > + * Oops instead of printing "Bad page map in process" message and
> > + * trying to continue.
> > + */
> > +static bool oops_if_bad_pte __ro_after_init = false;
> > +module_param(oops_if_bad_pte, bool, 0444);
> > +
> >  /*
> >   * This function is called to print an error when a bad pte
> >   * is found. For example, we might have a PFN-mapped pte in
> > @@ -490,6 +498,13 @@ static inline void add_mm_rss_vec(struct mm_struct *mm, int *rss)
> >  static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
> >  			  pte_t pte, struct page *page)
> >  {
> > +	/*
> > +	 * This line is a formality to collect vmcore ASAP. Real bug
> > +	 * (hardware or software) happened earlier, current registers and
> > +	 * backtrace aren't interesting.
> > +	 */
> > +	BUG_ON(oops_if_bad_pte);

  reply	other threads:[~2025-07-10 16:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 18:10 [PATCH] mm: implement "memory.oops_if_bad_pte=1" boot option Alexey Dobriyan
2025-07-09 22:37 ` Andrew Morton
2025-07-10 16:46   ` Alexey Dobriyan
2025-07-10  7:35 ` Vlastimil Babka
2025-07-10 16:47   ` Alexey Dobriyan [this message]
2025-07-10 16:16 ` Lorenzo Stoakes
2025-07-10 16:57   ` Alexey Dobriyan
2025-07-10 17:02     ` Lorenzo Stoakes
2025-07-10 18:29       ` Michal Hocko

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=1e49cfaf-4669-4b59-afdb-cc872dbcc950@p183 \
    --to=adobriyan@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /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).