Re: [PATCH] ARM: mm: compare ARM926 cache range sizes as unsigned
From: Linus Walleij
Date: Tue Oct 06 2026 - 06:19:09 EST
On Tue, Oct 6, 2026 at 7:53 AM Karl Mehltretter <kmehltretter@xxxxxxxxx> wrote:
> arm926_flush_user_cache_range() uses BGT to compare end - start
> with CACHE_DLIMIT. Sizes of 2 GiB or more are treated as negative
> and take the cache-line loop instead of the whole-cache path.
>
> Use BHI for an unsigned comparison, keeping the line-by-line path
> at exactly CACHE_DLIMIT.
>
> With the default 3G/1G split, unmapping an untouched 2 GiB
> PROT_NONE mapping flushes the range through tlb_start_vma().
> On a SAM9X75 Curiosity board, munmap() took about 1.3 seconds
> unpatched and 20 ms patched.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
Ooops!
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
Make sure to put this into Russell's patch tracker!
Yours,
Linus Walleij