From: Jiaqi Yan <jiaqiyan@google.com>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: jane.chu@oracle.com, nao.horiguchi@gmail.com,
tony.luck@intel.com, wangkefeng.wang@huawei.com,
akpm@linux-foundation.org, osalvador@suse.de,
rientjes@google.com, duenwen@google.com, jthoughton@google.com,
jgg@nvidia.com, ankita@nvidia.com, peterx@redhat.com,
linux-mm@kvack.org
Subject: Re: [RFC PATCH v1 1/2] mm/memory-failure: introduce global MFR policy
Date: Tue, 15 Oct 2024 16:58:51 -0700 [thread overview]
Message-ID: <CACw3F50KG2+-V4zuVkL1G8OqZitFKQuuqJbQ=bxH3BVj8w7SZQ@mail.gmail.com> (raw)
In-Reply-To: <b1bdd238-565c-ee6d-d7ac-a6cee90bd8fd@huawei.com>
On Fri, Oct 11, 2024 at 12:05 AM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> On 2024/10/4 7:51, Jiaqi Yan wrote:
> > Hi Jane,
> >
> > On Wed, Oct 2, 2024 at 4:50 PM <jane.chu@oracle.com> wrote:
> >>
> >> Hi,
> >>
> >> On 9/23/2024 9:39 PM, Jiaqi Yan wrote:
> >>>
> >>> + /*
> >>> + * On ARM64, if APEI failed to claims SEA, (e.g. GHES driver doesn't
> >>> + * register to SEA notifications from firmware), memory_failure will
> >>> + * never be synchrounous to the error consumption thread. Notifying
> >>> + * it via SIGBUS synchrnously has to be done by either core kernel in
> >>> + * do_mem_abort, or KVM in kvm_handle_guest_abort.
> >>> + */
> >>> + if (!sysctl_enable_hard_offline) {
> >>> + pr_info_once("%#lx: disabled by /proc/sys/vm/enable_hard_offline\n", pfn);
> >>> + kill_procs_now(p, pfn, flags, page_folio(p));
> >>> + res = -EOPNOTSUPP;
> >>> + goto unlock_mutex;
> >>> + }
> >>> +
> >>
> >> I am curious why the SIGBUS is sent without setting PG_hwpoison in the
> >> page. In 0/2 there seems to be indication about threads coordinate
> >> with each other such that clean subpages in a poisoned hugetlb page
> >> continue to be accessible, and at some point, (or perhaps I misread),
> >> the poisoned page (sub- or huge-) will eventually be isolated, because,
> >
> > The code here is "global policy". The "per-VMA policy", proposed in
> > 0/2 but code not sent, should be able to support isolation + offline
> > at some point (all VMAs are gone and page becomes free).
> >
> >> it's unthinkable to let a poisoned page laying around and kernel treats
> >> it like a clean page ? But I'm not sure how do you plan to handle it
> >> without PG_hwpoison while hard_offline is disabled globally.
> >
> > It will become the responsibility of a control plan running in
> > userspace. For example, the control plan immediately prevents starting
> > of any new workload/VM, but chooses to wait until memory errors exceed
> > a certain threshold, or hold on to the hosts until all workloads/VMs
> > are migrated and then repair the machine. Not setting PG_hwpoison is
> > indeed a big difference and risk, so it needs to be carefully handled
> > by userspace.
> >
>
> Could you explain why PG_hwpoison cannot be set in this case? It seems a control plan running in
> userspace can work with PG_hwpoison set. PG_hwpoison makes sure hwpoisoned pages won't be re-used
> by kernel while the control plan prevent them from re-accessed from userspace. Or am I miss something?
>
[Resend to include more people and linux-mm]
Sorry I almost missed your comment/question.
I think for hugetlb and transparent hugepages, say we keep them mapped
but set HWPoison flag, the flag will be set at compound head and
future userspace page fault on **any** part of the hugepage will
result in SIGBUS, meaning the hugepage is lost to the userspace,
making "keep them mapped" a meaningless action.
> Thanks.
> .
>
next prev parent reply other threads:[~2024-10-15 23:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 4:39 [RFC PATCH v1 0/2] Userspace Can Control Memory Failure Recovery Jiaqi Yan
2024-09-24 4:39 ` [RFC PATCH v1 1/2] mm/memory-failure: introduce global MFR policy Jiaqi Yan
2024-10-02 23:50 ` jane.chu
2024-10-03 23:51 ` Jiaqi Yan
2024-10-07 17:24 ` jane.chu
2024-10-10 23:21 ` Jiaqi Yan
2024-10-11 18:28 ` jane.chu
2024-10-11 19:44 ` Luck, Tony
2024-10-11 20:15 ` jane.chu
2024-10-15 23:45 ` Jiaqi Yan
2024-10-15 23:56 ` Luck, Tony
2024-10-16 0:19 ` jane.chu
2024-10-11 7:04 ` Miaohe Lin
2024-10-15 23:58 ` Jiaqi Yan [this message]
2024-09-24 4:39 ` [RFC PATCH v1 2/2] docs: mm: add enable_hard_offline sysctl Jiaqi Yan
2024-10-02 15:02 ` [RFC PATCH v1 0/2] Userspace Can Control Memory Failure Recovery Jason Gunthorpe
2024-10-03 22:45 ` Jiaqi Yan
2024-10-03 22:58 ` Luck, Tony
2024-10-03 23:19 ` Jiaqi Yan
2024-10-03 23:19 ` Jason Gunthorpe
2024-10-04 18:32 ` Jiaqi Yan
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='CACw3F50KG2+-V4zuVkL1G8OqZitFKQuuqJbQ=bxH3BVj8w7SZQ@mail.gmail.com' \
--to=jiaqiyan@google.com \
--cc=akpm@linux-foundation.org \
--cc=ankita@nvidia.com \
--cc=duenwen@google.com \
--cc=jane.chu@oracle.com \
--cc=jgg@nvidia.com \
--cc=jthoughton@google.com \
--cc=linmiaohe@huawei.com \
--cc=linux-mm@kvack.org \
--cc=nao.horiguchi@gmail.com \
--cc=osalvador@suse.de \
--cc=peterx@redhat.com \
--cc=rientjes@google.com \
--cc=tony.luck@intel.com \
--cc=wangkefeng.wang@huawei.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