percpu_ref_switch_to_percpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, this is percpu_ref_switch_to_percpu(9) from the Kernel API Manual, and it's literally here to switch a percpu_ref to percpu mode. That's the whole name β€” no cap. It's giving "specialized kernel refcount glow-up," not your everyday refcount situation ✨.

✨ SYNOPSIS ✨

void percpu_ref_switch_to_percpu (struct percpu_ref *ref );

πŸ’… ARGUMENTS πŸ’…

  • ref β€” the percpu_ref you want to switch to percpu mode. That's it, that's the argument πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first things first: there's no reason to use this function for the usual reference counting. like, none. if you're trying to re-use an expired ref, use percpu_ref_reinit instead, okay? 😌

This function switches ref to percpu mode. It may be invoked concurrently with all the get/put operations, and it can safely be mixed with kill and reinit operations β€” yes, bestie, it's built different πŸ”₯. It reverses the sticky atomic state set by PERCPU_REF_INIT_ATOMIC or percpu_ref_switch_to_atomic. If ref is dying or dead, the actual switching takes place on the following percpu_ref_reinit.

⚠️ heads up: this function may block if ref is in the process of switching to atomic mode. If the caller ensures that ref is not in the process of switching to atomic mode, this function can be called from any context. So like, know your ref's situation before you call, periodt πŸ’…

🌈 SEE ALSO 🌈


and that's the whole page, bestie 🫢 source/version is ./lib, date is October 2026, and percpu_ref_switch_to_percpu(9) is signing off πŸ’–βœ¨

πŸ“¦ where this page comes from