On Tue, Nov 03, 2026 at 06:50:28PM +0000, Chris Wiseman wrote:
> verity_ctr() creates a dedicated dm_io_client (v->io) for every
> dm-verity target, but its only caller is verity_recheck(), which reads
> a single data block into a page from v->recheck_pool after a hash
> mismatch. Because dm_io_client_create() preallocates a mempool of 16
> bios and 16 biovec-max (4 KiB) vectors per target, each dm-verity
> target permanently pins ~70 KiB of unreclaimable slab that a single-page
> read never uses (~2.4 MiB across 35 targets on Android, or ~4.1 MiB
> across 59 targets).
>
> Replace dm_io() in verity_recheck() with bdev_rw_virt() and remove
> v->io. bdev_rw_virt() puts the bio and single bio_vec on the stack and
> waits for completion, while keeping v->recheck_pool per-target.
>
> Fixes: 9177f3c0dea6 ("dm-verity: recheck the hash after a failure")
> Link:
> https://lore.kernel.org/dm-devel/[email protected]/
> Signed-off-by: Chris Wiseman <[email protected]>
Reviewed-by: Eric Biggers <[email protected]>
- Eric