Re: [PATCH v5 4/4] percpu: Fix hint invariant breakage
From: Andrew Morton
Date: Tue May 12 2026 - 18:50:30 EST
On Sun, 10 May 2026 07:21:49 +0000 Joonwon Kang <joonwonkang@xxxxxxxxxx> wrote:
> The invariant "scan_hint_start > contig_hint_start if and only if
> scan_hint == contig_hint" should be kept for hint management. However,
> it could be broken in some cases:
>
> - if (new contig == contig_hint == scan_hint) && (contig_hint_start <
> scan_hint_start < new contig start) && the new contig is to become a
> new contig_hint due to its better alignment, then scan_hint should
> be invalidated instead of keeping the old value.
>
> - if (new contig == contig_hint > scan_hint) && (new contig start <
> contig_hint_start) && the new contig is not to become a new
> contig_hint, then scan_hint should be not updated to the new contig.
>
> This commit mainly fixes this invariant breakage and includes more:
Thanks. AI review asked a single question:
https://sashiko.dev/#/patchset/20260510072149.1279887-1-joonwonkang@xxxxxxxxxx