percpu_ref_kill(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Bestie!! πŸ’– You're reading the Kernel API Manual, and today's main character is percpu_ref_kill(9) β€” the "drop the initial ref" girlie. Let's get into it. πŸŽ€


✨ NAME ✨

percpu_ref_kill β€” drop the initial ref 🫢


🌸 SYNOPSIS 🌸

void percpu_ref_kill (struct percpu_ref *ref );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ref β€” the percpu_ref you're about to kill πŸ’€. That's it. That's the whole argument. Slay.

πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea, bestie. 🍡 You must use percpu_ref_kill to drop the initial ref on a percpu refcount. And the way that it has to be called is precisely once before shutdown. Not twice. Not zero times. Precisely once. Periodt. πŸ‘‘

What it's doing under the hood: it switches ref into atomic mode first, then gathers up the percpu counters, and then drops the initial ref. So it's serving atomic-mode realness before it cleans up the counters. ✨

⚠️ Major vibe check: there are no implied RCU grace periods between kill and release. None. Zero. Nada. Don't be out here assuming one, because the kernel is not giving it to you. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/percpu-refcount.h β€” go read it, bestie, it's right there 🫢:


And that's the whole page, bestie!! πŸ’– This little masterpiece lives in ./include/linux, dated October 2026, and it's filed under percpu_ref_kill(9) β€” mwah, catch you on the next man page! πŸ’‹πŸŽ€

πŸ“¦ where this page comes from