From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: Kyle Meyer <kyle.meyer@hpe.com>, Jiaqi Yan <jiaqiyan@google.com>,
jane.chu@oracle.com, "Liam R. Howlett" <Liam.Howlett@oracle.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
surenb@google.com, "Anderson, Russ" <russ.anderson@hpe.com>,
rppt@kernel.org, osalvador@suse.de, nao.horiguchi@gmail.com,
mhocko@suse.com, lorenzo.stoakes@oracle.com,
linmiaohe@huawei.com, david@redhat.com, bp@alien8.de,
akpm@linux-foundation.org, linux-mm@kvack.org, vbabka@suse.cz,
linux-acpi@vger.kernel.org, Shawn Fan <shawn.fan@intel.com>
Subject: Re: PATCH v3 ACPI: APEI: GHES: Don't offline huge pages just because BIOS asked
Date: Wed, 10 Sep 2025 14:01:23 +0200 [thread overview]
Message-ID: <CAJZ5v0hihNmnnB2x9q2JobGQJirmj0Q5oHFmKfOsqesjGvD4-A@mail.gmail.com> (raw)
In-Reply-To: <aL82BsIJht3HIIS3@agluck-desk3>
Hi Tony,
On Mon, Sep 8, 2025 at 10:01 PM Luck, Tony <tony.luck@intel.com> wrote:
>
> On Mon, Sep 08, 2025 at 02:14:42PM -0500, Kyle Meyer wrote:
> > Optionally, a 3rd setting could be added to /proc/sys/vm/enable_soft_offline:
> >
> > 0: Soft offline is disabled.
> > 1: Soft offline is enabled for normal pages (skip hugepages).
> > 2: Soft offline is enabled for normal pages and hugepages.
>
> Seems like a solid plan.
>
> Needs an update to Documentation/admin-guide/sysctl/vm.rst
> to match the new functionality and describe the reason that
> users might want to avoid taking huge pages offline.
>
> Also this line in existing text:
>
> - On ARM, the request to soft offline pages from GHES driver.
>
> should read:
>
> - On ARM and X86, the request to soft offline pages from GHES driver.
>
> >
> > Maybe something like...
> >
> > diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> > index fc30ca4804bf..efa535d405a8 100644
> > --- a/mm/memory-failure.c
> > +++ b/mm/memory-failure.c
> > @@ -64,11 +64,17 @@
> > #include "internal.h"
> > #include "ras/ras_event.h"
> >
> > +enum soft_offline {
> > + SOFT_OFFLINE_DISABLED = 0,
> > + SOFT_OFFLINE_ENABLED_SKIP_HUGEPAGES,
> > + SOFT_OFFLINE_ENABLED
> > +};
> > +
> > static int sysctl_memory_failure_early_kill __read_mostly;
> >
> > static int sysctl_memory_failure_recovery __read_mostly = 1;
> > -static int sysctl_enable_soft_offline __read_mostly = 1;
> > +static int sysctl_enable_soft_offline __read_mostly = SOFT_OFFLINE_SKIP_HUGEPAGES;
>
> This is changing the default behavior (which allowed offline
> of huge pages). I'm in favor of the change. But you should call it
> out explicitly in the commit message when you write up a patch.
>
> >
> > atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);
> >
> > @@ -150,7 +156,7 @@ static const struct ctl_table memory_failure_table[] = {
> > .mode = 0644,
> > .proc_handler = proc_dointvec_minmax,
> > .extra1 = SYSCTL_ZERO,
> > - .extra2 = SYSCTL_ONE,
> > + .extra2 = SYSCTL_TWO,
> > }
> > };
> >
> > @@ -2799,12 +2805,20 @@ int soft_offline_page(unsigned long pfn, int flags)
> > return -EIO;
> > }
> >
> > - if (!sysctl_enable_soft_offline) {
> > - pr_info_once("disabled by /proc/sys/vm/enable_soft_offline\n");
> > + if (sysctl_enable_soft_offline == SOFT_OFFLINE_DISABLED) {
> > + pr_info("disabled by /proc/sys/vm/enable_soft_offline\n");
> > put_ref_page(pfn, flags);
> > return -EOPNOTSUPP;
> > }
> >
> > + if (sysctl_enable_soft_offline == SOFT_OFFLINE_ENABLED_SKIP_HUGEPAGES) {
> > + if (folio_test_hugetlb(pfn_folio(pfn))) {
> > + pr_info("disabled by /proc/sys/vm/enable_soft_offline\n");
> > + put_ref_page(pfn, flags);
> > + return -EOPNOTSUPP;
> > + }
> > + }
> > +
> > mutex_lock(&mf_mutex);
> >
> > if (PageHWPoison(page)) {
> >
> > > > I don't know, the patch itself is fine, it's the issue that it has
> > > > exposed that is more concerning.
Is the $subject patch still relevant?
I gather from the conversation following it that it isn't.
next prev parent reply other threads:[~2025-09-10 12:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 15:57 [PATCH] " Tony Luck
2025-09-04 17:25 ` Mike Rapoport
2025-09-04 18:16 ` Liam R. Howlett
2025-09-05 15:53 ` [PATCH v2] " Luck, Tony
2025-09-05 16:25 ` Liam R. Howlett
2025-09-05 18:17 ` PATCH v3 " Luck, Tony
2025-09-05 19:39 ` jane.chu
2025-09-05 19:58 ` Luck, Tony
2025-09-05 20:14 ` jane.chu
2025-09-05 20:36 ` Luck, Tony
2025-09-05 19:59 ` Jiaqi Yan
2025-09-08 19:14 ` Kyle Meyer
2025-09-08 20:01 ` Luck, Tony
2025-09-10 12:01 ` Rafael J. Wysocki [this message]
2025-09-18 3:39 ` Shuai Xue
2025-09-18 15:43 ` Jiaqi Yan
2025-09-18 18:45 ` Luck, Tony
2025-09-19 1:53 ` Shuai Xue
2025-09-18 19:46 ` Luck, Tony
2025-09-19 1:49 ` Shuai Xue
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=CAJZ5v0hihNmnnB2x9q2JobGQJirmj0Q5oHFmKfOsqesjGvD4-A@mail.gmail.com \
--to=rafael@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=david@redhat.com \
--cc=jane.chu@oracle.com \
--cc=jiaqiyan@google.com \
--cc=kyle.meyer@hpe.com \
--cc=linmiaohe@huawei.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=nao.horiguchi@gmail.com \
--cc=osalvador@suse.de \
--cc=rafael.j.wysocki@intel.com \
--cc=rppt@kernel.org \
--cc=russ.anderson@hpe.com \
--cc=shawn.fan@intel.com \
--cc=surenb@google.com \
--cc=tony.luck@intel.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