> On Sep 21, 2026, at 20:53, Oscar Salvador (SUSE) <[email protected]> wrote:
>
> On Thu, Sep 03, 2026 at 08:21:25PM +0800, Muchun Song wrote:
>> pmem_mkpage_present() is called after persistent-memory poison has been
>> cleared. It only needs to clear PG_hwpoison and undo the MCE nospec state
>> for PFNs that are still marked poisoned.
>>
>> For clean PFNs, test_and_clear_pmem_poison() has no semantic effect, but it
>> still performs an atomic clear operation against struct page flags. That is
>> unnecessary today and conflicts with the FS-DAX vmemmap optimization added
>> later in the series, where clean PFNs may be backed by shared read-only
>> metadata.
>>
>> Check PageHWPoison() first so only poisoned PFNs update the page state.
>> Poison recovery keeps the same behavior, while clean PFNs no longer require
>> writable per-PFN metadata.
>>
>> Signed-off-by: Muchun Song <[email protected]>
>
> Then change itself looks good to me, so
>
> Reviewed-by: Oscar Salvador <[email protected]>
Thanks for your review.
>
> but any reason not to hide the PageHWPoison check within
> test_and_clear_pmem_poison()?
I indeed hadn't considered this point before. But now I find it
unnecessary, because a patch [1] has already removed
test_and_clear_pmem_poison().
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
Muchun
>
>
>
> --
> Oscar Salvador
> SUSE Labs