percpu_ref_kill_and_confirm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– percpu_ref_kill_and_confirm(9) πŸ’–

omg hi bestie, welcome to the Kernel API Manual β€” today’s main character is percpu_ref_kill_and_confirm, and she is here to drop the initial ref and schedule confirmation πŸ’…βœ¨


✨ NAME ✨

percpu_ref_kill_and_confirm β€” drop the initial ref and schedule confirmation πŸŽ€

🌸 SYNOPSIS 🌸

void percpu_ref_kill_and_confirm (struct percpu_ref *ref , percpu_ref_func_t *confirm_kill );

πŸŽ€ ARGUMENTS πŸŽ€

  • ref β€” the percpu_ref to kill. yes, we’re ending it πŸ’€
  • confirm_kill β€” optional confirmation callback. if it’s not NULL, the kill confirmation gets scheduled; if it is NULL, there’s no confirmation callback to schedule. lowkey simple 🫢

πŸ”₯ DESCRIPTION πŸ”₯

okay so this is equivalent to percpu_ref_kill, but it also schedules kill confirmation if confirm_kill is not NULL. confirm_kill, which may not block, will be called after ref is seen as dead from all CPUs β€” at which point all further invocations of percpu_ref_tryget_live will fail. see percpu_ref_tryget_live for details πŸ‘‘

this function normally doesn’t block and can be called from any context, but bestie… it may block if confirm_kill is specified and ref is in the process of switching to atomic mode by percpu_ref_switch_to_atomic. so like, usually no blocking, but that specific situation? blocking. noted πŸ’…

🚨 important vibe check: there are no implied RCU grace periods between kill and release. no cap.

🌈 SEE ALSO 🌈

kernel file ./lib/percpu-refcount.c has the whole friend group:


stay slay, bestie πŸ’œ this one comes from the ./lib source, dated October 2026 β€” percpu_ref_kill_and_confirm(9), out πŸ’‹βœ¨

πŸ“¦ where this page comes from