percpu_ref_tryget_many(9)
π percpu_ref_tryget_many(9) π
okay so bestie, welcome to the Kernel API Manual, section 9 β the coolest corner of the kernel docs fr fr. today's main character? a little function called percpu_ref_tryget_many. it's giving "polite bouncer at the refcount club" energy and honestly? we're obsessed π«Ά
β¨ NAME β¨
percpu_ref_tryget_many β try to increment a percpu refcount
like, it tries. it doesn't just barge in. we love a function with manners π
πΈ SYNOPSIS πΈ
bool percpu_ref_tryget_many (struct percpu_ref *ref , unsigned long nr
);
yes the line break is real, no we're not fixing it, it's canon π
π¦ ARGUMENTS π¦
refβ thepercpu_refyou're trying to try-get. that's the one, that's the target, that's the vibe check recipient πnrβ how many references you're trying to get. not one.nr. we're doing a bundle today, bestie β¨
π DESCRIPTION π
So here's the tea: this function increments a percpu refcount by nr β unless its count has already hit zero π. In that case, nope, not today, no refs for you.
It returns true on success and false on failure. Simple. Iconic. Periodt. π
π important lil' caveat: this function is only safe to call as long as ref is between init and exit. Outside that window? don't. literally don't. ngl the kernel does not care about your feelings there.
π SEE ALSO π
Bestie, the whole friend group is here β and yes, the kernel file path is part of the crew, don't @ me:
- Kernel file
./include/linux/percpu-refcount.h percpu_ref_kill(9)percpu_ref_get_many(9)percpu_ref_get(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)
the way this list literally ate π go read all of them, iykyk π
mwah π that's the whole page! brought to you from ./include/linux, dated October 2026, straight outta the Kernel API Manual (section 9, obviously π). go forth and try-get responsibly, bestie β fr fr no cap π§ββοΈβ¨
π¦ 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