kfree_rcu_nolock(9)
π kfree_rcu_nolock β from the Kernel API Manual, section 9, bestie
Okay so picture this: it's giving "the chill version of kfree_rcu()" and honestly? iconic. Welcome to kfree_rcu_nolock(9), the page where RCU lets you free stuff from literally anywhere. Let's get into it π«Ά
β¨ NAME β¨
kfree_rcu_nolock β a version of kfree_rcu() that can be called in any context. Yes, any. No cap. π
πΈ SYNOPSIS πΈ
kfree_rcu_nolock (ptr , kvrhf );
That's it, that's the whole vibe. Two args, zero drama π
π¦ ARGUMENTS π¦
ptrβ pointer to kfree for double-argument invocations. Like, this is the thing you're yeeting into the void ποΈkvrhfβ the name of the structkvfree_rcu_headwithin the type ofptr. Yeah, it's a field name, not a value β read it carefully bestie, it matters π
π DESCRIPTION π
Okay so with KVFREE_RCU_BATCHED, kfree_rcu_nolock tries hard to free objects without any deferred processing β like it's genuinely making an effort, main character energy β but it may still defer freeing. So it's not a guarantee, it's a "probably" π
Also lowkey important: large kmalloc and vmalloc objects are always deferred. No exceptions, no shortcuts, periodt π₯
And the tea β: kfree_rcu_nolock supports the 2-arg variant only. That's the whole menu, don't ask for more π
β οΈ Heads up bestie β "tries hard" β "always does it". If your object is big (kmalloc or vmalloc), it's deferred, full stop. Don't build your whole design around it happening immediately π
π SEE ALSO π
This list is long, and the way I'm obsessed with it β grab a snack, we're going through all of them π
Kernel file ./include/linux/rcupdate.h, plus: same_state_synchronize_rcu(9), cond_resched_tasks_rcu_qs(9), rcu_softirq_qs_periodic(9), RCU_LOCKDEP_WARN(9), lockdep_assert_in_rcu_read_lock(9), lockdep_assert_in_rcu_read_lock_bh(9), lockdep_assert_in_rcu_read_lock_sched(9), lockdep_assert_in_rcu_reader(9), unrcu_pointer(9), RCU_INITIALIZER(9), rcu_assign_pointer(9), rcu_replace_pointer(9), rcu_access_pointer(9), rcu_dereference_check(9), rcu_dereference_bh_check(9), rcu_dereference_sched_check(9), rcu_dereference_all_check(9), rcu_dereference_protected(9), rcu_dereference(9), rcu_dereference_bh(9), rcu_dereference_sched(9), rcu_dereference_all(9), rcu_pointer_handoff(9), rcu_read_lock(9), rcu_read_unlock(9), rcu_read_lock_bh(9), rcu_read_unlock_bh(9), rcu_read_lock_sched(9), rcu_read_unlock_sched(9), RCU_INIT_POINTER(9), RCU_POINTER_INITIALIZER(9), kfree_rcu(9), kfree_rcu_mightsleep(9), rcu_head_init(9), rcu_head_after_call_rcu(9)
β¨ that's the whole page, you ate that β¨
This little gem lives over in ./include/linux (the rcupdate.h corner of the world π), and it's dated October 2026 β future-dated and fabulous, as she should be. Mwah π π§ββοΈ
π¦ 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