ib_umem_find_best_pgoff(9)
π
ib_umem_find_best_pgoff (9) β Kernel API Manual π
okay so bestie, welcome to the glow-up page for ib_umem_find_best_pgoff π this one lives in the Kernel API Manual and it's literally about picking the best hardware page size, so let's get into it β¨
πΈ NAME πΈ
ib_umem_find_best_pgoff β find best HW page size π«Ά
β¨ SYNOPSIS β¨
unsigned long ib_umem_find_best_pgoff (struct ib_umem *umem , unsigned
long pgsz_bitmap , u64 pgoff_bitmask );
no cap, that's the whole signature π
π¦ ARGUMENTS π¦
umemβ theumemstruct π like, the thing you're working onpgsz_bitmapβ bitmap of HW supported page sizes πpgoff_bitmaskβ mask of bits that can be represented with an offset π
π DESCRIPTION π
so this one is very similar to ib_umem_find_best_pgsz, except β plot twist β instead of accepting an IOVA, it accepts a bitmask specifying what address bits can be represented with a page offset π
for instance, if the HW has multiple page sizes, requires 64 byte alignemnt, and can support aligned offsets up to 4032, then pgoff_bitmask would be "111111000000" β (yes that's the literal string in the source, don't come for me π)
and here's the vibe check that matters: if the pgoff_bitmask requires either alignment in the low bit or an unavailable page size for the high bits, this function returns 0 π like, it's giving "no valid answer" energy.
fr fr, that 0 return is a real outcome, not a suggestion β handle it π«Ά
π RETURN π
best HW page size for the parameters, or 0 if none available for the given parameters π
π₯ SEE ALSO π₯
- Kernel file
./include/rdma/ib_umem.hπ¦
π sign-off π
that's the whole page babes π
it came from ./include/rdma and it's dated October 2026 β go forth and pick the best page size, you absolute icon π§ββοΈπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms