ib_umem_dmab...ble_and_lock(9)
π
ib_umem_dmab...ble_and_lock(9) β the Kernel API Manual, bestie edition π
okay so this is a page from the Kernel API Manual and the function's full government name is ib_umem_dmabuf_get_pinned_revocable_and_lock (yes the header squishes it, we don't do that here β¨).
πΈ NAME πΈ
ib_umem_dmabuf_get_pinned_revocable_and_lock β map & pin a revocable dmabuf. that's it. that's the vibe. π¦
β¨ SYNOPSIS β¨
struct ib_umem_dmabuf * ib_umem_dmabuf_get_pinned_revocable_and_lock
(struct ib_device *device , unsigned long offset , size_t size , int fd
, int access );
like, she takes five things and returns a struct ib_umem_dmabuf *, no big deal π
π«Ά ARGUMENTS π«Ά
deviceβ the IB device. the main character we're doing all this for πoffsetβ start offset. where we begin, bestie πsizeβ length. how much we're grabbing πfdβ dmabuf fd. the little file descriptor doorway πͺaccessβ access flags. the permissions vibe check β
π DESCRIPTION π
so what does she actually do? she obtains a umem from a dmabuf, but specifically for drivers/devices that can support revocation. highkey a special-guest situation π₯
she returns with dma_resv_lock held upon success β no cap, the lock is yours now. and here's the thing the driver must do: set the revoke callback prior to unlock by calling ib_umem_dmabuf_set_revoke_locked. do not skip this step, i'm begging π
when a revocation occurs, the revoke callback gets called. the driver must ensure that the region is no longer accessed when the callback returns. and honestly? any subsequent access attempts should also probably cause an AE for MRs. it's giving consequences, periodt π
if the umem is used for an MR, the driver must ensure that the key remains in use such that it cannot be obtained by a new region until this region is fully deregistered (i.e., ibv_dereg_mr). if a driver needs to serialize with revoke calls, it can use dma_resv_lock β she's right there, use her π
if successful, then the revoke callback may be called at any time and will also be called automatically upon ib_umem_release (serialized). and the cutest part? the revoke callback will be called one time at most. no spam, no repeats, we love a considerate king π
ngl none of the above is optional. read it twice. the AE thing and the key thing are literally load-bearing π§
π RETURN π
a pointer to ib_umem_dmabuf on success, or an ERR_PTR on failure. slay or cry, there is no in between πβ¨
π¦ SEE ALSO π¦
Kernel file ./drivers/infiniband/core/umem_dmabuf.c β go read the source, iykyk π
and that's the whole page, bestie π«Ά this lil drop came from ./drivers/infiniband/core and it's dated October 2026 β literally iconic behavior, go forth and revoke responsibly π
β¨
π¦ 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