All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	 linux-doc@vger.kernel.org, kernel-team@meta.com,
	Naoya Horiguchi <nao.horiguchi@gmail.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	 Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 1/2] mm/memory-failure: add panic_on_unrecoverable_memory_failure sysctl
Date: Mon, 30 Mar 2026 06:45:21 -0700	[thread overview]
Message-ID: <acp8wYLHDGAfhzI5@gmail.com> (raw)
In-Reply-To: <a88d62ee-530c-1a6e-c05f-de324f940b8f@huawei.com>

On Mon, Mar 30, 2026 at 03:55:00PM +0800, Miaohe Lin wrote:
> On 2026/3/23 23:29, Breno Leitao wrote:
>
> > @@ -1298,6 +1309,10 @@ static int action_result(unsigned long pfn, enum mf_action_page_type type,
> >  	pr_err("%#lx: recovery action for %s: %s\n",
> >  		pfn, action_page_types[type], action_name[result]);
> >  
> > +	if (sysctl_panic_on_unrecoverable_mf &&
> > +	    type == MF_MSG_GET_HWPOISON && result == MF_IGNORED)
> > +		panic("Memory failure: %#lx: unrecoverable page", pfn);
> 
> MF_MSG_GET_HWPOISON contains some other scenarios. For example, an isolated folio will
> make get_hwpoison_page return -EIO so we will see MF_MSG_GET_HWPOISON and MF_IGNORED in
> action_result. But that's recoverable if folio is used by userspace thus panic will be
> unacceptable.
> Will it better to check type against MF_MSG_KERNEL_HIGH_ORDER?

Yes, I was discussing this with akpm, and maybe the better
approach would be to panic for types MF_MSG_KERNEL_HIGH_ORDER and MF_MSG_KERNEL.

In both cases, it seems that, the page would not be able to migrate. What do
you think about a change like this:


@@ -1298,6 +1309,10 @@ static int action_result(unsigned long pfn, enum mf_action_page_type type,
        pr_err("%#lx: recovery action for %s: %s\n",
                pfn, action_page_types[type], action_name[result]);

+       if (sysctl_panic_on_unrecoverable_mf && result == MF_IGNORED &&
+           (type == MF_MSG_KERNEL || type == MF_MSG_KERNEL_HIGH_ORDER))
+               panic("Memory failure: %#lx: unrecoverable page", pfn);
+
        return (result == MF_RECOVERED || result == MF_DELAYED) ? 0 : -EBUSY;
 }


  reply	other threads:[~2026-03-30 13:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 15:29 [PATCH 0/2] mm/memory-failure: add panic option for unrecoverable pages Breno Leitao
2026-03-23 15:29 ` [PATCH 1/2] mm/memory-failure: add panic_on_unrecoverable_memory_failure sysctl Breno Leitao
2026-03-30  7:55   ` Miaohe Lin
2026-03-30 13:45     ` Breno Leitao [this message]
2026-03-31  2:27       ` Miaohe Lin
2026-03-31 10:25         ` Breno Leitao
2026-03-23 15:29 ` [PATCH 2/2] Documentation: document " Breno Leitao
2026-03-23 16:51   ` Randy Dunlap
2026-03-24 10:09     ` Breno Leitao
2026-03-24 11:48       ` Akira Yokosawa
2026-03-24 16:27         ` Randy Dunlap

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=acp8wYLHDGAfhzI5@gmail.com \
    --to=leitao@debian.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=kernel-team@meta.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nao.horiguchi@gmail.com \
    --cc=skhan@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.