percpu_ref_tryget(9)
π percpu_ref_tryget β the Kernel API Manual edition, bestie β¨
okay so real talk, this one lives in the Kernel API Manual and it is literally the politest little refcount function you will ever meet π
πΈ NAME πΈ
percpu_ref_tryget β bestie's whole job is: try to increment a percpu refcount. that's it. that's the vibe π«Ά
β¨ SYNOPSIS β¨
bool percpu_ref_tryget (struct percpu_ref *ref );
she takes one thing and she gives you back a bool, no cap π
π¦ ARGUMENTS π¦
refβ thepercpu_refyou're try-getting. like, this is the refcount you're attempting to bump, mwah π
π₯ DESCRIPTION π₯
so here's the tea β β percpu_ref_tryget increments a percpu refcount unless its count already reached zero. if it's already zero, she simply does not, and honestly? respect π
Returns true on success; false on failure. iconic behaviour, no notes π
β οΈ also important, bestie: this function is safe to call as long as ref is between init and exit. that's the window, that's the assignment, do not test her outside of it π
π SEE ALSO π
Kernel file ./include/linux/percpu-refcount.h β the mothership, the main character herself π
percpu_ref_kill(9)percpu_ref_get_many(9)percpu_ref_get(9)percpu_ref_tryget_many(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)
go read the whole friend group, they're all serving π
and that's a wrap, bestie! π§ this one shipped from ./include/linux, dated October 2026, and the page goes by percpu_ref_tryget(9) in case you need to cite her in the group chat ππ
β¨
π¦ 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