All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Uladzislau Rezki (Sony)" <urezki@gmail.com>
Subject: [for-next][PATCH 13/13] tracing: Switch to kvfree_rcu() API
Date: Tue, 07 Dec 2021 16:44:19 -0500	[thread overview]
Message-ID: <20211207214431.312363234@goodmis.org> (raw)
In-Reply-To: 20211207214406.148423650@goodmis.org

From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>

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 | 3 +--
 kernel/trace/trace_probe.c   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 7520d43aed55..4719a848bf17 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -138,8 +138,7 @@ static void osnoise_unregister_instance(struct trace_array *tr)
 	if (!found)
 		return;
 
-	synchronize_rcu();
-	kfree(inst);
+	kvfree_rcu(inst);
 }
 
 /*
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 3ed2a3f37297..8a3822818bf8 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -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);
-- 
2.33.0

      parent reply	other threads:[~2021-12-07 21:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 21:44 [for-next][PATCH 00/13] tracing: Updates for 5.17 Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 01/13] tracing: Fix spelling mistake "aritmethic" -> "arithmetic" Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 02/13] tracing: Support __rel_loc relative dynamic data location attribute Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 03/13] tracing: Add __rel_loc using trace event macros Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 04/13] samples/trace_event: Add __rel_loc using sample event Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 05/13] libtraceevent: Add __rel_loc relative location attribute support Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 06/13] tools/perf: Add __rel_loc event field parsing support Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 07/13] tracing: Use __this_cpu_read() in trace_event_buffer_lock_reserver() Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 08/13] tracing: Disable preemption when using the filter buffer Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 09/13] tracing: Have eprobes use filtering logic of trace events Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 10/13] tracing/kprobes: Do not open code event reserve logic Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 11/13] tracing/uprobes: Use trace_event_buffer_reserve() helper Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 12/13] tracing: Fix synth_event_add_val() kernel-doc comment Steven Rostedt
2021-12-07 21:44 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211207214431.312363234@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=urezki@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.