diff options
author | Uladzislau Rezki (Sony) <urezki@gmail.com> | 2022-10-25 16:46:12 +0200 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2023-01-04 02:48:40 +0100 |
commit | 04a522b7da3dbc083f8ae0aa1a6184b959a8f81c (patch) | |
tree | 492ecb846a88726dbc2221b93b6217ad8200ce5c /kernel/rcu/tiny.c | |
parent | Linux 6.2-rc1 (diff) | |
download | linux-04a522b7da3dbc083f8ae0aa1a6184b959a8f81c.tar.xz linux-04a522b7da3dbc083f8ae0aa1a6184b959a8f81c.zip |
rcu: Refactor kvfree_call_rcu() and high-level helpers
Currently a kvfree_call_rcu() takes an offset within a structure as
a second parameter, so a helper such as a kvfree_rcu_arg_2() has to
convert rcu_head and a freed ptr to an offset in order to pass it. That
leads to an extra conversion on macro entry.
Instead of converting, refactor the code in way that a pointer that has
to be freed is passed directly to the kvfree_call_rcu().
This patch does not make any functional change and is transparent to
all kvfree_rcu() users.
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/tiny.c')
-rw-r--r-- | kernel/rcu/tiny.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index 72913ce21258..42f7589e51e0 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c @@ -246,15 +246,12 @@ bool poll_state_synchronize_rcu(unsigned long oldstate) EXPORT_SYMBOL_GPL(poll_state_synchronize_rcu); #ifdef CONFIG_KASAN_GENERIC -void kvfree_call_rcu(struct rcu_head *head, rcu_callback_t func) +void kvfree_call_rcu(struct rcu_head *head, void *ptr) { - if (head) { - void *ptr = (void *) head - (unsigned long) func; - + if (head) kasan_record_aux_stack_noalloc(ptr); - } - __kvfree_call_rcu(head, func); + __kvfree_call_rcu(head, ptr); } EXPORT_SYMBOL_GPL(kvfree_call_rcu); #endif |