[Devel] [PATCH hci-8.1 1/3] fs/fuse kio: teach pcs_umem about hugepage-backed mappings

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Sep 30 10:41:56 MSK 2026


> pcs_umem pins every mapping as a flat array of 4k pages and the krpc
> bvec builder emits one bio_vec per page, so a 1M chunk costs 256 page
> pointers and 256 bio_vecs even when it sits in a single hugepage.
> 
> Detect hugepage backing after pinning: if the range is 2M-aligned and
> each 2M chunk is backed by one folio (hugetlbfs or fully-mapped THP),
> keep only the folio head page per chunk and raise umem->page_shift to
> PMD_SHIFT. The bvec builder then caps bv_len at the backing unit
> instead of PAGE_SIZE, so a 1M chunk in a hugepage umem becomes a
> single bio_vec. Mixed or misaligned mappings stay at 4k.
> 
> Also pin with pin_user_pages_fast(), which needs no mmap_lock, and
> fix the pcs_umem_get() error path, which leaked chunk page arrays and
> could deref a NULL page_chunk.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-142166
> 
> Signed-off-by: Liu Kui <kui.liu at virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20260930-sockio-refactor-8-1-v1-0-806348b9eb26@virtuozzo.com?part=1




More information about the Devel mailing list