Re: [PATCH v2 1/3] mm, swap: ratelimit bad swap entry reports
From: Nhat Pham
Date: Mon Aug 17 2026 - 18:52:53 EST
On Thu, Aug 13, 2026 at 3:03 AM Breno Leitao <leitao@xxxxxxxxxx> 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.
>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
Reviewed-by: Nhat Pham <nphamcs@xxxxxxxxx>