percpu_ref_kill_and_confirm(9)
π 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β thepercpu_refto kill. yes, weβre ending it πconfirm_killβ optional confirmation callback. if itβs notNULL, the kill confirmation gets scheduled; if it isNULL, 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:
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_is_zero(9)percpu_ref_reinit(9)percpu_ref_resurrect(9)
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
- 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