percpu_ref_exit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

percpu_ref_exit β€” the undo button for percpu_ref_init(), straight from the Kernel API Manual πŸ’…


πŸ› οΈ SYNOPSIS πŸ› οΈ

void percpu_ref_exit (struct percpu_ref *ref );

πŸŽ€ ARGUMENTS πŸŽ€

  • ref β€” the percpu_ref you want to exit, bestie. That’s the one getting undone here 🫢

🌸 DESCRIPTION 🌸

Okay so this function exits ref. Literally what it says on the tin ✨

The caller is responsible for ensuring that ref is no longer in active use. No cap, that part is on you β€” make sure it’s actually done being used before you call this πŸ™ˆ

The usual places to invoke this function from are:

  • the ref->release callback, or
  • in the init failure path where percpu_ref_init succeeded but other parts of the initialization of the embedding object failed.

That’s the vibe: cleanup when the ref is done, or cleanup when the rest of your setup didn’t make it 😭


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./lib/percpu-refcount.c


source/version ./lib, date October 2026, page percpu_ref_exit(9) β€” catch u later, bye bestie πŸ˜˜πŸ’–

πŸ“¦ where this page comes from