Re: [PATCH] mm, swap: ratelimit bad swap entry reports
From: David Hildenbrand (Arm)
Date: Tue Aug 18 2026 - 13:24:35 EST
On 8/18/26 11:03, Breno Leitao wrote:
> A corrupt page table hands the same bogus entry to get_swap_device() on
> every access to the mapping, and every rejection is logged. One machine
> logged 6185620 copies of the same line in a few hours.
>
> swap_dup_entry_direct() prints the same message from the fork path, once
> per call: the WARN_ON_ONCE() guarding it warns once, the pr_err() inside
> does not.
>
> Rate limit all three prints.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 23b230ba8ac3 ("mm/swap: print bad swap offset entry in get_swap_device")
> Reviewed-by: Barry Song <baohua@xxxxxxxxxx>
> Reviewed-by: Nhat Pham <nphamcs@xxxxxxxxx>
> Acked-by: Kairui Song <kasong@xxxxxxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> ---
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David