refcount_dec(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

refcount_dec(9) β€” decrement a refcount, and yep this is the Kernel API Manual page for it, bestie πŸ’–

✨ SYNOPSIS ✨

void refcount_dec (refcount_t *r );

πŸ’… ARGUMENTS πŸ’…

  • r β€” the refcount, aka the lil counter getting decremented 🫢

🌸 DESCRIPTION 🌸

Okay so listen: refcount_dec is similar to atomic_dec, but with boundaries and main-character safety energy. It will WARN on underflow 😭 and it will fail to decrement when it's saturated at REFCOUNT_SATURATED. Like, the counter said β€œnope, we're maxed out,” periodt.

It also provides release memory ordering, such that prior loads and stores are done before. So the earlier load/store business is completed first β€” release ordering slay πŸ’…βœ¨

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/refcount.h is the home base 🏠 β€” go give these related pages some love too:


Sign-off time πŸŽ€ this page lives in the ./include/linux source tree, dated October 2026, and it's literally refcount_dec(9) β€” bye bestie, go decrement responsibly πŸ’–πŸ¦‹

πŸ“¦ where this page comes from