ib_umem_find_best_pgoff(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the umem struct πŸ’… like, the thing you're working on
  • pgsz_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