percpu_ref_kill(9)
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β thepercpu_refyou'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 π«Ά:
percpu_ref_get_many(9)percpu_ref_get(9)percpu_ref_tryget_many(9)percpu_ref_tryget(9)percpu_ref_tryget_live_rcu(9)percpu_ref_tryget_live(9)percpu_ref_put_many(9)percpu_ref_put(9)percpu_ref_is_dying(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms