kvfree_rcu_barrier(9)
π kvfree_rcu_barrier π
okay bestie, welcome to the kvfree_rcu_barrier(9) page β that's the kernel API manual, section 9, and yes we're gonna get through it together π«Ά
β¨ NAME β¨
kvfree_rcu_barrier β literally just sits there and waits until every single in-flight kvfree_rcu() call has finished. no cap. it's the "hold on, everyone get in the car before we leave" of kernel functions ππ¨
β¨ SYNOPSIS β¨
void kvfree_rcu_barrier (void );
that's it. that's the whole vibe check. π
β¨ ARGUMENTS β¨
voidβ no arguments. nada. zero. she takes nothing and gives you patience πΈ
β¨ DESCRIPTION β¨
okay so listen, this part is important so put your phone down for a sec π
a single argument of a kvfree_rcu call has a slow path. that slow path triggers a synchronize_rcu and then frees the pointer. and the way that it is done β it's done before the return from the function. so like, by the time you get back out of the call, that whole sequence already happened β¨
so because of that: for any single-argument call that will result in a kfree to a cache that is going to be destroyed during module exit, it is the developer's responsibility to make sure all of those calls have returned before the call to kmem_cache_destroy. π
bestie this is on YOU. nobody's coming to save you. if you kmem_cache_destroy while those calls are still in flight, that's a you problem π please make sure they returned first, fr fr.
β¨ SEE ALSO β¨
go check these out, they're all in the kernel file ./mm/slab_common.c πβ¨
__kmem_cache_create_args(9)kmem_buckets_create(9)kmem_cache_shrink(9)kmem_dump_obj(9)kfree_sensitive(9)struct kvfree_rcu_bulk_data(9)struct kfree_rcu_cpu_work(9)struct kfree_rcu_cpu(9)kvfree_rcu_barrier_on_cache(9)
aaaand that's the page! π little sign-off for you: this one lives in ./mm, it's the October 2026 version, and the whole thing is the kvfree_rcu_barrier(9) page from your Kernel API Manual. go forth and wait for your in-flight calls before you destroy that cache, icon ππ¦
π¦ 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