[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f12dfacb-05dd-4b22-90eb-fcc1a8ed552b@linux.dev>
Date: Mon, 13 Oct 2025 12:42:44 +0800
From: Lance Yang <lance.yang@...ux.dev>
To: Miaohe Lin <linmiaohe@...wei.com>, qiuxu.zhuo@...el.com
Cc: Longlong Xia <xialonglong2025@....com>, nao.horiguchi@...il.com,
akpm@...ux-foundation.org, wangkefeng.wang@...wei.com, xu.xin16@....com.cn,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Longlong Xia <xialonglong@...inos.cn>, david@...hat.com
Subject: Re: [PATCH RFC 1/1] mm/ksm: Add recovery mechanism for memory
failures
On 2025/10/13 11:39, Miaohe Lin wrote:
> On 2025/10/11 17:38, Lance Yang wrote:
>>
>>
>> On 2025/10/11 17:23, Miaohe Lin wrote:
>>> On 2025/10/11 15:52, Lance Yang wrote:
>>>> @Miaohe
>>>>
>>>> I'd like to raise a concern about a potential hardware failure :)
>>>
>>> Thanks for your thought.
>>>
>>>>
>>>> My tests show that if the shared zeropage (or huge zeropage) gets marked
>>>> with HWpoison, the kernel continues to install it for new mappings.
>>>> Surprisingly, it does not kill the accessing process ...
>>>
>>> Have you investigated the cause? If user space writes to shared zeropage,
>>> it will trigger COW and a new page will be installed. After that, reading
>>> the newly allocated page won't trigger memory error. In this scene, it does
>>> not kill the accessing process.
>>
>> Not write just read :)
>>
>>>
>>>>
>>>> The concern is, once the page is no longer zero-filled due to the hardware
>>>> failure, what will happen? Would this lead to silent data corruption for
>>>> applications that expect to read zeros?
>>>
>>> IMHO, once the page is no longer zero-filled due to the hardware failure, later
>>> any read will trigger memory error and memory_failure should handle that.
>>
>> I've only tested injecting an error on the shared zeropage using corrupt-pfn:
>>
>> echo $PFN > /sys/kernel/debug/hwpoison/corrupt-pfn
>>
>> But no memory error was triggered on a subsequent read ...
>
> It's because corrupt-pfn only provides a software error injection mechanism.
> If you want to trigger memory error on read, you need use hardware error injection
> mechanism e.g.APEI Error INJection [1].
>
> [1] https://www.kernel.org/doc/html/v5.8/firmware-guide/acpi/apei/einj.html
Nice! You're right, thanks for pointing that out!
I'm not very familiar with hardware error injection. Fortunately, Qiuxu
is looking
into that and running some tests on the shared zeropage.
Well, I think he will follow up with his findings ;p
Cheers,
Lance
Powered by blists - more mailing lists