Re: [PATCH v2] mm/swapfile: unuse_pte can map random data if swap read fails

Miaohe Lin
2022-04-19T12:00:38Z

On 2022/4/19 19:46, David Hildenbrand wrote:
...
>> Do you mean that we should set the pfn to 0 for the hwpoison marker so that we can
>> distinguish swapin error case from real hwpoison case?
>
> I am not sure if we really have to distinguish. However, "0" seems to
> make sense to indicate "this is not an actual problematic PFN, the
> information is simply no longer around due to a hardware issue.
>

IMHO, we have to distinguish. For example, we might need to return VM_FAULT_SIGBUS
instead of VM_FAULT_HWPOISON when user accesses the error page. Or should we simply
return VM_FAULT_HWPOISON to simplify the handling?

Thanks!