On 28/11/2025 11:37, Harry Yoo wrote:
Currently, kvfree_rcu_barrier() flushes RCU sheaves across all slab caches when a cache is destroyed. This is unnecessary when destroying a slab cache; only the RCU sheaves belonging to the cache being destroyed need to be flushed. As suggested by Vlastimil Babka, introduce a weaker form of kvfree_rcu_barrier() that operates on a specific slab cache and call it on cache destruction. The performance benefit is evaluated on a 12 core 24 threads AMD Ryzen 5900X machine (1 socket), by loading slub_kunit module. Before: Total calls: 19 Average latency (us): 8529 Total time (us): 162069 After: Total calls: 19 Average latency (us): 3804 Total time (us): 72287 Link: https://lore.kernel.org/linux-mm/[email protected] Link: https://lore.kernel.org/linux-mm/[email protected] Link: https://lore.kernel.org/linux-mm/[email protected] Suggested-by: Vlastimil Babka <[email protected]> Signed-off-by: Harry Yoo <[email protected]> ---
Thanks for the rapid fix. I have been testing this and can confirm that this does fix the performance regression I was seeing.
BTW shouldn't we add a 'Fixes:' tag above? I would like to ensure that this gets picked up for v6.18 stable.
Otherwise ... Tested-by: Jon Hunter <[email protected]> Thanks! Jon -- nvpublic

