]> git.baikalelectronics.ru Git - kernel.git/commitdiff
tracing: Switch to kvfree_rcu() API
authorUladzislau Rezki (Sony) <urezki@gmail.com>
Wed, 24 Nov 2021 11:03:08 +0000 (12:03 +0100)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 6 Dec 2021 22:53:50 +0000 (17:53 -0500)
Instead of invoking a synchronize_rcu() to free a pointer
after a grace period we can directly make use of new API
that does the same but in more efficient way.

Link: https://lkml.kernel.org/r/20211124110308.2053-10-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_osnoise.c
kernel/trace/trace_probe.c

index 7520d43aed5540691603cba105c5ad2543969021..4719a848bf174051a190ce09193e2aa687ef1bc1 100644 (file)
@@ -138,8 +138,7 @@ static void osnoise_unregister_instance(struct trace_array *tr)
        if (!found)
                return;
 
-       synchronize_rcu();
-       kfree(inst);
+       kvfree_rcu(inst);
 }
 
 /*
index 3ed2a3f372972cd3fe9e83fb142c1a608a57be9f..8a3822818bf88e23cfb190ee1d2e9474d7b9c44f 100644 (file)
@@ -1138,8 +1138,7 @@ int trace_probe_remove_file(struct trace_probe *tp,
                return -ENOENT;
 
        list_del_rcu(&link->list);
-       synchronize_rcu();
-       kfree(link);
+       kvfree_rcu(link);
 
        if (list_empty(&tp->event->files))
                trace_probe_clear_flag(tp, TP_FLAG_TRACE);