rcuref_put_rcusafe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so this is the Kernel API Manual page for rcuref_put_rcusafe, and the official NAME line is literally:

  • rcuref_put_rcusafe β€” - - Release one reference for a rcuref reference count RCU safe

She releases one reference for a rcuref reference count, RCU safe. periodt. πŸ’…


πŸ’… SYNOPSIS πŸ’…

bool rcuref_put_rcusafe (rcuref_t *ref );

bestie, that’s the whole signature: bool coming back at you, and rcuref_t *ref going in. 🫢


🌸 ARGUMENTS 🌸

  • ref β€” Pointer to the reference count. That’s the one and only argument, no hidden extras. ✨

✨ DESCRIPTION ✨

It provides release memory ordering β€” prior loads and stores are done before β€” and on success it provides acquire ordering such that free must come after. The memory model is watching, so we respect the ordering. πŸ‘€

You can invoke it from contexts which guarantee that no grace period can happen which would free the object concurrently if the decrement drops the last reference and the slowpath races against a concurrent get and put pair. rcu_read_lock'ed contexts and atomic contexts qualify. πŸ¦‹

False if there are still active references or the put raced with a concurrent get/put pair.

🚨 And when that happens, the caller is not allowed to release the protected object. Do not do it. Not today. πŸ™…β€β™€οΈ

πŸ”₯ RETURN πŸ”₯

True if this was the last reference with no future references possible. That’s the signal to the caller that it can safely release the object which is protected by the reference counter. iconic behavior, honestly. πŸ‘‘πŸŽ‰


πŸ¦‹ SEE ALSO πŸ¦‹


source/version: ./include/linux Β· date: October 2026 Β· page: rcuref_put_rcusafe(9) β€” bye bestie, go release that reference safely πŸ’–βœ¨

πŸ“¦ where this page comes from