On 2/3/25 10:28, Vlastimil Babka wrote: > Following the move of the TREE_RCU batching kvfree_rcu() implementation > to slab, we still have the simple non-batching implementation in tiny > RCU, and RCU implementation specific ifdefs in slab code. > > Finish the move and integration into slab. Allow using the simple > call_rcu() based implementation also with tree RCU when SLUB_TINY is > enabled, as its goal is also to limit memory footprint with less concern > for top performance. > > In order to avoid RCU having to recognize the fake callback function > pointers (__is_kvfree_rcu_offset()) when handling call_rcu(), implement > a callback that can calculate the object's address from the embedded > rcu_head pointer without knowing the specific offset (previously SLOB > would not have made it possible, but it's gone now). > > After this series, AFAIK only the following kvfree_rcu specific code > remains in RCU: > > - a call to kfree_rcu_scheduler_running() from rcu_set_runtime_mode() > > - probably necessary and a generic registration interface would be > unnecessary bloat? > > - declarations of kfree_rcu() API in include/linux/rcupdate.h > > - could be moved to slab.h after checking for/fixing up potential > missing includes > > git tree: > https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=b4/slub-tiny-kfree_rcu > > Changes since RFC [1]: > - Rebased to v6.14-rc1 > - Fixed build errors reported by bots. > - Changed where kvfree_call_rcu() is moved to in patch 1 to avoid another > move in patch 4. > - R-b's by Ulad and Joel > - Fix a memory leak in kvfree_rcu_list() thanks to Ulad > - Various comments' improvements and fixes (Joel, Ulad) > - Rename config to CONFIG_KFREE_RCU_BATCHED (Ulad) > > Due to changes, didn't keep Paul's Tested-by (but thanks!) > > Will include in slab/for-next if no objection. Now done, thanks to Paul for testing and Harry for reviews!