Re: [PATCH 2/2] mm: kmemleak: scan the struct page array in MAX_SCAN_SIZE batches

From: Catalin Marinas

Date: Tue Sep 22 2026 - 05:54:48 EST


On Mon, Sep 21, 2026 at 05:30:27AM -0700, Breno Leitao wrote:
> scan_zone_pages() scans the struct page array one page per scan_block()
> call:
>
> if (scan_block(page, page + 1, NULL))
>
> scan_block() takes kmemleak_lock with interrupts disabled for the
> duration of the call, so this acquires the lock once per online PFN to
> scan a single struct page.
>
> Gather runs of adjacent eligible struct pages and pass each run to
> scan_block() in one call, capped at MAX_SCAN_SIZE.
>
> The longest kmemleak_lock is now held is MAX_SCAN_SIZE worth of words,

Remove an 'is'. Also, MAX_SCAN_SIZE worth of bytes rather than words.

Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>