xe_bo_put_deferred(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ xe_bo_put_deferred(9) ✨

okay so bestie, welcome to the Kernel API Manual entry for xe_bo_put_deferred β€” yes it's a mouthful, yes it's giving "GPU buffer object girlboss", and yes we're gonna get through it together 🫢


🌸 NAME 🌸

xe_bo_put_deferred β€” put a buffer object with delayed final freeing πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

bool xe_bo_put_deferred (struct xe_bo *bo , struct llist_head *deferred
);

literally that's it. one function, two args, returns a bool. iconic.


πŸŽ€ ARGUMENTS πŸŽ€

  • bo β€” the bo we're putting. the buffer object in question, the main character of this whole situation πŸ‘‘
  • deferred β€” the list we add the buffer object to if we can't put it. or NULL if the function is supposed to put unconditionally. no list, no problem, we just go for it ✨

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” the final freeing of an object includes both sleeping and (!) memory allocation in the dma_resv individualization. yeah, both. in the same breath. so it is not ok to put an object from atomic context, and it's also not ok from within a held lock tainted by reclaim. ngl that's a whole vibe violation 😭

in those situations, we want to defer the final freeing until we've exited the restricting context β€” or, in the worst case, push it all the way to a workqueue. lowkey the workqueue is the group chat where things get handled later πŸ’€

so this function does one of two things:

  • puts the object, if that's possible without the refcount reaching zero, or
  • adds it to the deferred list if that wasn't possible.

the caller then needs to follow up with a call to xe_bo_put_commit to actually put the bo iff this function returns true. and yes, it's totally safe to always follow up with a call to xe_bo_put_commit β€” so like, no cap, you can just always do it 🫢

TODO note from the original, verbatim in spirit: "It's TTM that is the villain here. Perhaps TTM should add an interface like this." not me calling out TTM in the manpage πŸ˜­πŸ’€

⭐ RETURN ⭐

true if bo was the first object put on the freed list, false otherwise. that's the whole return contract, bestie, memorize it πŸŽ€


🌈 SEE ALSO 🌈

kernel file ./drivers/gpu/drm/xe/xe_bo.h enum, plus the whole friend group:

like, read them, they're all slaying in their own way ✨


and that's the page!! 🧚 sign-off time: this one lives in ./drivers/gpu/drm/xe, dated October 2026, and it's the xe_bo_put_deferred(9) page β€” go forth and defer your frees responsibly, bestie πŸ’œπŸ”₯

πŸ“¦ where this page comes from