Re: Re: [PATCH 2/3] mm/memory-failure.c: support reset PTE during unpoison
flat view
From: zhenwei pi <hidden>
Date: 2022-05-30 05:51:06
Also in:
linux-mm, lkml, qemu-devel
On 5/30/22 13:02, HORIGUCHI NAOYA(堀口 直也) wrote:
On Fri, May 20, 2022 at 03:06:47PM +0800, zhenwei pi wrote:quoted
Origianlly, unpoison_memory() is only used by hwpoison-inject, and unpoisons a page which is poisoned by hwpoison-inject too. The kernel PTE entry has no change during software poison/unpoison. On a virtualization platform, it's possible to fix hardware corrupted page by hypervisor, typically the hypervisor remaps the error HVA(host virtual address). So add a new parameter 'const char *reason' to show the reason called by. Once the corrupted page gets fixed, the guest kernel needs put page to buddy. Reuse the page and hit the following issue(Intel Platinum 8260): BUG: unable to handle page fault for address: ffff888061646000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 2c01067 P4D 2c01067 PUD 61aaa063 PMD 10089b063 PTE 800fffff9e9b9062 Oops: 0002 [#1] PREEMPT SMP NOPTI CPU: 2 PID: 31106 Comm: stress Kdump: loaded Tainted: G M OE 5.18.0-rc6.bm.1-amd64 #6 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 RIP: 0010:clear_page_erms+0x7/0x10 The kernel PTE entry of the fixed page is still uncorrected, kernel hits page fault during prep_new_page. So add 'bool reset_kpte' to get a change to fix the PTE entry if the page is fixed by hypervisor. Signed-off-by: zhenwei pi <redacted> --- include/linux/mm.h | 2 +- mm/hwpoison-inject.c | 2 +- mm/memory-failure.c | 26 +++++++++++++++++++------- 3 files changed, 21 insertions(+), 9 deletions(-)Do you need undoing rate limiting here? In the original unpoison's usage, avoiding flood of "Unpoison: Software-unpoisoned page" messages is helpful. And unpoison seems to be called from virtio-balloon multiple times when the backend is 2MB hugepages. If it's right, printing out 512 lines of "Unpoison: Unpoisoned page 0xXXX by virtio-balloon" messages might not be so helpful?
All the suggestions(include '[PATCH 1/3] memory-failure: Introduce memory failure notifier') are reasonable, I'll fix them in the next version. Thanks a lot! -- zhenwei pi _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization