percpu_ref_tryget_many(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the percpu_ref you'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:

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