percpu_ref_reinit(9)
β¨ percpu_ref_reinit β¨
okay so this is the manual page for percpu_ref_reinit, from the Kernel API Manual besties π
like yes we're reading kernel docs for fun now, that's the energy
πΈ NAME πΈ
percpu_ref_reinit β re-initialize a percpu refcount π
π¦ SYNOPSIS π¦
void percpu_ref_reinit (struct percpu_ref *ref );
π ARGUMENTS π
refβ theperpcu_refyou wanna re-initialize π«Ά (yes that's exactly how it's spelled in the source, no I'm not fixing it, iykyk)
β DESCRIPTION β
So the vibe here is: you take ref and you put it right back into the same state it was in when percpu_ref_init finished β except we're ignoring PERCPU_REF_INIT_DEAD for this one. like a little reset button, but make it fashion β¨
π¨ important bestie: ref must have already been initialized successfully and it must have reached 0 and it must not have exited. all three. no skipping. that's the vibe check and if it fails, we're not doing this π
Also, and this is lowkey the cool part: percpu_ref_tryget[_live]() are totally safe to run on ref while this function is still in progress. yes, mid-function. it's giving main character energy π₯
π SEE ALSO π
- Kernel file
./lib/percpu-refcount.c percpu_ref_init(9)percpu_ref_exit(9)percpu_ref_switch_to_atomic(9)percpu_ref_switch_to_atomic_sync(9)percpu_ref_switch_to_percpu(9)percpu_ref_kill_and_confirm(9)percpu_ref_is_zero(9)percpu_ref_resurrect(9)
like a whole little percpu refcount friend group honestly, go say hi π
and that's the whole page babes β¨ this iconic little entry lives in ./lib, dated October 2026 β ok that date ate honestly π go forth and reinit responsibly π§π
π¦ 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