diff options
author | Julia Lawall <Julia.Lawall@inria.fr> | 2024-06-09 10:27:13 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2024-06-09 16:26:49 +0200 |
commit | 4534429f17a00fa98d6b34ac00a819b42cebd4d5 (patch) | |
tree | 1b4d74aac1de750412029348233dc1c2d3e435a4 /tools/testing/selftests/arm64/signal/testcases/fake_sigreturn_sve_change_vl.c | |
parent | wireguard: selftests: use acpi=off instead of -no-acpi for recent QEMU (diff) | |
download | wireguard-linux-stable.tar.xz wireguard-linux-stable.zip |
Since SLOB was removed, it is not necessary to use call_rcu when the
callback only performs kmem_cache_free. Use kfree_rcu() directly.
The changes were done using the following Coccinelle semantic patch.
This semantic patch is designed to ignore cases where the callback
function is used in another way.
// <smpl>
@r@
expression e;
local idexpression e2;
identifier cb,f;
position p;
@@
(
call_rcu(...,e2)
|
call_rcu(&e->f,cb@p)
)
@r1@
type T;
identifier x,r.cb;
@@
cb(...) {
(
kmem_cache_free(...);
|
T x = ...;
kmem_cache_free(...,x);
|
T x;
x = ...;
kmem_cache_free(...,x);
)
}
@s depends on r1@
position p != r.p;
identifier r.cb;
@@
cb@p
@script:ocaml@
cb << r.cb;
p << s.p;
@@
Printf.eprintf "Other use of %s at %s:%d\n"
cb (List.hd p).file (List.hd p).line
@depends on r1 && !s@
expression e;
identifier r.cb,f;
position r.p;
@@
- call_rcu(&e->f,cb@p)
+ kfree_rcu(e,f)
@r1a depends on !s@
type T;
identifier x,r.cb;
@@
- cb(...) {
(
- kmem_cache_free(...);
|
- T x = ...;
- kmem_cache_free(...,x);
|
- T x;
- x = ...;
- kmem_cache_free(...,x);
)
- }
// </smpl>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions