Re: [PATCH v2 1/3] mm, swap: ratelimit bad swap entry reports
From: Barry Song
Date: Mon Aug 17 2026 - 06:15:31 EST
On Thu, Aug 13, 2026 at 6:02 PM 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: Barry Song <baohua@xxxxxxxxxx>