Re: [PATCH] mm,swapops: Update check in is_pfn_swap_entry for hwpoison entries
From: Oscar Salvador
Date: Sun Apr 07 2024 - 09:56:36 EST
On Sun, Apr 07, 2024 at 03:05:37PM +0200, Oscar Salvador wrote:
> Tony reported that the Machine check recovery was broken in v6.9-rc1,
> as he was hitting a VM_BUG_ON when injecting uncorrectable memory errors
> to DRAM.
> After some more digging and debugging on his side, he realized that this
> went back to v6.1, with the introduction of 'commit 0d206b5d2e0d ("mm/swap: add
> swp_offset_pfn() to fetch PFN from swap entry")'.
> That commit, among other things, introduced swp_offset_pfn(), replacing
> hwpoison_entry_to_pfn() in its favour.
>
> The patch also introduced a VM_BUG_ON() check for is_pfn_swap_entry(),
> but is_pfn_swap_entry() never got updated to cover hwpoison entries, which
> means that we would hit the VM_BUG_ON whenever we would call
> swp_offset_pfn() for such entries on environments with CONFIG_DEBUG_VM set.
> Fix this by updating the check to cover hwpoison entries as well, and update
> the comment while we are it.
>
> Reported-by: Tony Luck <tony.luck@xxxxxxxxx>
> Closes: https://lore.kernel.org/all/Zg8kLSl2yAlA3o5D@agluck-desk3/
> Tested-by: Tony Luck <tony.luck@xxxxxxxxx>
> Fixes: 0d206b5d2e0d ("mm/swap: add swp_offset_pfn() to fetch PFN from swap entry")
> Cc: <stable@xxxxxxxxxxxxxxx> # 6.1.x
I think I need to clarify why the stable.
It is my understanding that some distros ship their kernel with
CONFIG_DEBUG_VM set by default (I think Fedora comes to my mind?).
I am fine with backing down if people think that this is an
overreaction.
--
Oscar Salvador
SUSE Labs