Commit a6ed2aee authored by Uladzislau Rezki (Sony)'s avatar Uladzislau Rezki (Sony) Committed by Steven Rostedt (VMware)
Browse files

tracing: Switch to kvfree_rcu() API

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: default avatarUladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 1d83c3a2
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -138,8 +138,7 @@ static void osnoise_unregister_instance(struct trace_array *tr)
	if (!found)
	if (!found)
		return;
		return;


	synchronize_rcu();
	kvfree_rcu(inst);
	kfree(inst);
}
}


/*
/*
+1 −2
Original line number Original line Diff line number Diff line
@@ -1138,8 +1138,7 @@ int trace_probe_remove_file(struct trace_probe *tp,
		return -ENOENT;
		return -ENOENT;


	list_del_rcu(&link->list);
	list_del_rcu(&link->list);
	synchronize_rcu();
	kvfree_rcu(link);
	kfree(link);


	if (list_empty(&tp->event->files))
	if (list_empty(&tp->event->files))
		trace_probe_clear_flag(tp, TP_FLAG_TRACE);
		trace_probe_clear_flag(tp, TP_FLAG_TRACE);