linux-kernelorg-stable/kernel/rcu
Vlastimil Babka 49d5377b38 rcu, slab: use a regular callback function for kvfree_rcu
RCU has been special-casing callback function pointers that are integers
lower than 4096 as offsets of rcu_head for kvfree() instead. The tree
RCU implementation no longer does that as the batched kvfree_rcu() is
not a simple call_rcu(). The tiny RCU still does, and the plan is also
to make tree RCU use call_rcu() for SLUB_TINY configurations.

Instead of teaching tree RCU again to special case the offsets, let's
remove the special casing completely. Since there's no SLOB anymore, it
is possible to create a callback function that can take a pointer to a
middle of slab object with unknown offset and determine the object's
pointer before freeing it, so implement that as kvfree_rcu_cb().

Large kmalloc and vmalloc allocations are handled simply by aligning
down to page size. For that we retain the requirement that the offset is
smaller than 4096. But we can remove __is_kvfree_rcu_offset() completely
and instead just opencode the condition in the BUILD_BUG_ON() check.

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
2025-02-05 10:45:29 +01:00
..
Kconfig rcu: Add rcuog kthreads to RCU_NOCB_CPU help text 2024-11-12 21:41:08 +01:00
Kconfig.debug rcutorture: Make rcutorture_one_extend() check reader state 2024-12-14 17:04:55 +01:00
Makefile
rcu.h Merge branches 'context_tracking.15.08.24a', 'csd.lock.15.08.24a', 'nocb.09.09.24a', 'rcutorture.14.08.24a', 'rcustall.09.09.24a', 'srcu.12.08.24a', 'rcu.tasks.14.08.24a', 'rcu_scaling_tests.15.08.24a', 'fixes.12.08.24a' and 'misc.11.08.24a' into next.09.09.24a 2024-09-09 00:09:47 +05:30
rcu_segcblist.c rcu/nocb: Simplify (de-)offloading state machine 2024-09-09 00:03:55 +05:30
rcu_segcblist.h rcu: Remove unused declaration rcu_segcblist_offload() 2024-10-22 15:36:56 +02:00
rcuscale.c rcuscale: Remove redundant WARN_ON_ONCE() splat 2024-11-15 22:24:41 +01:00
rcutorture.c rcutorture: Use symbols for SRCU reader flavors 2024-12-14 17:06:08 +01:00
refscale.c refscale: Add test for sched_clock() 2024-12-14 16:16:33 +01:00
srcutiny.c rcu/srcutiny: don't return before reenabling preemption 2024-11-12 21:45:20 +01:00
srcutree.c srcu: Remove redundant GP sequence checks in srcu_funnel_gp_start 2024-12-14 17:13:24 +01:00
sync.c rcu: Eliminate lockless accesses to rcu_sync->gp_count 2024-07-04 13:48:57 -07:00
tasks.h RCU pull request for v6.13 2024-11-19 11:27:07 -08:00
tiny.c rcu, slab: use a regular callback function for kvfree_rcu 2025-02-05 10:45:29 +01:00
tree.c rcu: remove trace_rcu_kvfree_callback 2025-02-05 10:45:20 +01:00
tree.h Merge branches 'context_tracking.15.08.24a', 'csd.lock.15.08.24a', 'nocb.09.09.24a', 'rcutorture.14.08.24a', 'rcustall.09.09.24a', 'srcu.12.08.24a', 'rcu.tasks.14.08.24a', 'rcu_scaling_tests.15.08.24a', 'fixes.12.08.24a' and 'misc.11.08.24a' into next.09.09.24a 2024-09-09 00:09:47 +05:30
tree_exp.h rcu: Add lockdep_assert_irqs_disabled() to rcu_exp_need_qs() 2024-12-14 17:10:38 +01:00
tree_nocb.h rcu/nocb: Fix missed RCU barrier on deoffloading 2024-11-12 22:51:52 +01:00
tree_plugin.h Kthreads affinity follow either of 4 existing different patterns: 2025-01-21 17:10:05 -08:00
tree_stall.h rcu: Finer-grained grace-period-end checks in rcu_dump_cpu_stacks() 2024-11-03 21:55:35 +01:00
update.c torture: Add dowarn argument to torture_sched_setaffinity() 2024-12-14 16:38:23 +01:00