[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e49cfaf-4669-4b59-afdb-cc872dbcc950@p183>
Date: Thu, 10 Jul 2025 19:47:47 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, David Hildenbrand <david@...hat.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH] mm: implement "memory.oops_if_bad_pte=1" boot option
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@...il.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);
Powered by blists - more mailing lists