From: Kaitao Cheng <kaitao.cheng@linux.dev>
To: "Huang, Ying" <ying.huang@linux.alibaba.com>,
Yuanhe Shu <xiangzao@linux.alibaba.com>
Cc: david@kernel.org, akpm@linux-foundation.org, vbabka@kernel.org,
linmiaohe@huawei.com, nao.horiguchi@gmail.com, ziy@nvidia.com,
wangkefeng.wang@huawei.com, tujinjiang@huawei.com,
mgorman@techsingularity.net, chengkaitao@kylinos.cn,
muchun.song@linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mm/compaction: skip folios containing hwpoisoned pages
Date: Tue, 20 Oct 2026 19:27:42 +0800 [thread overview]
Message-ID: <fbd5ae06-b6da-48f6-9c46-188fb6ba9684@linux.dev> (raw)
In-Reply-To: <877bjowf9i.fsf@DESKTOP-5N7EMDA>
在 2026/10/11 21:14, Huang, Ying 写道:
> Yuanhe Shu <xiangzao@linux.alibaba.com> writes:
>
>> On 9/28/26 20:12, David Hildenbrand wrote:
>>> On 9/28/26 12:58, Yuanhe Shu wrote:
>>>> folio_mc_copy() does not close this hole: it only detects corruption
>>>> at copy time and only where ARCH_HAS_COPY_MC is implemented (x86_64
>>>> and PPC64; elsewhere copy_mc_highpage() degrades to a plain copy).
>>>
>>> Then they should implement it.
>>
>> Agreed, and nothing here replaces copy_mc. Two things the check adds
>> while that work is pending: on archs without copy_mc the plain copy
>> does not fail, it consumes the poison - the same poison consumption
>> commit 841a8bfcbad9 ("mm: prevent poison consumption when splitting
>> THP") refused to risk on the split path, at your suggestion; and the
>> refusal happens before the copy is attempted at all, while copy_mc
>> recovers only during the read. The check and copy_mc compose.
>>
>
> Is it good to implement the trick in copy_mc_user_highpage() and
> copy_mc_highpage() if the macro copy_mc_to_kernel is undefined?
On architectures with hardware error correction and exception recovery
support, accessing faulty memory automatically triggers an exception,
which itself guarantees atomicity.
On architectures without such support, even if we implement this logic
in copy_mc_user_highpage() and copy_mc_highpage(), checking the hwpoison
flag and copying the data remain two separate operations. They cannot
be performed atomically, so there is still a race window between them,
however small.
Moving the hwpoison check after the copy might address this issue.
Is there anything wrong with my understanding?
> ---
> Best Regards,
> Huang, Ying
--
Thanks
Kaitao Cheng
next prev parent reply other threads:[~2026-10-20 11:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 10:58 [PATCH 0/2] mm: don't migrate folios containing hwpoisoned pages Yuanhe Shu
2026-09-28 10:58 ` [PATCH 1/2] mm/compaction: skip " Yuanhe Shu
2026-09-28 12:12 ` David Hildenbrand (Arm)
2026-09-29 3:41 ` Yuanhe Shu
2026-10-11 13:14 ` Huang, Ying
2026-10-20 7:16 ` Yuanhe Shu
2026-10-20 7:52 ` David Hildenbrand (Arm)
2026-10-20 11:27 ` Kaitao Cheng [this message]
2026-10-20 13:07 ` David Hildenbrand (Arm)
2026-10-20 13:31 ` Kaitao Cheng
2026-10-20 13:58 ` David Hildenbrand (Arm)
2026-10-10 8:35 ` Kaitao Cheng
2026-09-28 10:58 ` [PATCH 2/2] mm/migrate: refuse to migrate " Yuanhe Shu
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=fbd5ae06-b6da-48f6-9c46-188fb6ba9684@linux.dev \
--to=kaitao.cheng@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=chengkaitao@kylinos.cn \
--cc=david@kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=muchun.song@linux.dev \
--cc=nao.horiguchi@gmail.com \
--cc=tujinjiang@huawei.com \
--cc=vbabka@kernel.org \
--cc=wangkefeng.wang@huawei.com \
--cc=xiangzao@linux.alibaba.com \
--cc=ying.huang@linux.alibaba.com \
--cc=ziy@nvidia.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