From: David Hildenbrand <david@redhat.com>
To: zhenwei pi <pizhenwei@bytedance.com>,
Naoya Horiguchi <naoya.horiguchi@linux.dev>
Cc: akpm@linux-foundation.org, naoya.horiguchi@nec.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Wu Fengguang <fengguang.wu@intel.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH 3/4] mm/memofy-failure.c: optimize hwpoison_filter
Date: Fri, 6 May 2022 18:28:11 +0200 [thread overview]
Message-ID: <ac3fc5b9-d09c-5fb6-998d-f7c655d7fa00@redhat.com> (raw)
In-Reply-To: <3c0e25fb-695d-4a29-6de4-c892f89cea7a@bytedance.com>
On 06.05.22 15:38, zhenwei pi wrote:
>
>
> On 5/6/22 16:59, Naoya Horiguchi wrote:
>> On Fri, Apr 29, 2022 at 10:22:05PM +0800, zhenwei pi wrote:
>>> In the memory failure procedure, hwpoison_filter has higher priority,
>>> if memory_filter() filters the error event, there is no need to do
>>> the further work.
>>
>> Could you clarify what problem you are trying to solve (what does
>> "optimize" mean in this context or what is the benefit)?
>>
>
> OK. The background of this work:
> As well known, the memory failure mechanism handles memory corrupted
> event, and try to send SIGBUS to the user process which uses this
> corrupted page.
>
> For the virtualization case, QEMU catches SIGBUS and tries to inject MCE
> into the guest, and the guest handles memory failure again. Thus the
> guest gets the minimal effect from hardware memory corruption.
>
> The further step I'm working on:
> 1, try to modify code to decrease poisoned pages in a single place
> (mm/memofy-failure.c: simplify num_poisoned_pages_dec in this series).
>
> 2, try to use page_handle_poison() to handle SetPageHWPoison() and
> num_poisoned_pages_inc() together. It would be best to call
> num_poisoned_pages_inc() in a single place too. I'm not sure if this is
> possible or not, please correct me if I misunderstand.
>
> 3, introduce memory failure notifier list in memory-failure.c: notify
> the corrupted PFN to someone who registers this list.
> If I can complete [1] and [2] part, [3] will be quite easy(just call
> notifier list after increasing poisoned page).
>
> 4, introduce memory recover VQ for memory balloon device, and registers
> memory failure notifier list. During the guest kernel handles memory
> failure, balloon device gets notified by memory failure notifier list,
> and tells the host to recover the corrupted PFN(GPA) by the new VQ.
Most probably you might want to do that asynchronously, and once the
callback succeeds, un-poison the page.
>
> 5, host side remaps the corrupted page(HVA), and tells the guest side to
> unpoison the PFN(GPA). Then the guest fixes the corrupted page(GPA)
> dynamically.
I think QEMU already does that during reboots. Now it would be triggered
by the guest for individual pages.
>
> Because [4] and [5] are related to balloon device, also CC Michael,
> David and Jason.
Doesn't sound too crazy for me, although it's a shame that we always
have to use virtio-balloon for such fairly balloon-unrelated things.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2022-05-06 16:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 14:22 [PATCH 0/4] memory-failure: fix hwpoison_filter zhenwei pi
2022-04-29 14:22 ` [PATCH 1/4] mm/memory-failure.c: move clear_hwpoisoned_pages zhenwei pi
2022-05-06 8:55 ` Naoya Horiguchi
2022-04-29 14:22 ` [PATCH 2/4] mm/memofy-failure.c:: simplify num_poisoned_pages_dec zhenwei pi
2022-05-06 8:55 ` Naoya Horiguchi
2022-04-29 14:22 ` [PATCH 3/4] mm/memofy-failure.c: optimize hwpoison_filter zhenwei pi
2022-05-06 8:59 ` Naoya Horiguchi
2022-05-06 13:38 ` zhenwei pi
2022-05-06 16:28 ` David Hildenbrand [this message]
2022-05-07 0:28 ` zhenwei pi
2022-05-07 8:20 ` Naoya Horiguchi
2022-05-07 9:19 ` zhenwei pi
2022-04-29 14:22 ` [PATCH 4/4] mm/memofy-failure.c: add hwpoison_filter for soft offline zhenwei pi
2022-05-06 8:59 ` Naoya Horiguchi
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=ac3fc5b9-d09c-5fb6-998d-f7c655d7fa00@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mst@redhat.com \
--cc=naoya.horiguchi@linux.dev \
--cc=naoya.horiguchi@nec.com \
--cc=pizhenwei@bytedance.com \
--cc=virtualization@lists.linux-foundation.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 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).