[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210428134422.1894-3-urezki@gmail.com>
Date: Wed, 28 Apr 2021 15:44:20 +0200
From: "Uladzislau Rezki (Sony)" <urezki@...il.com>
To: LKML <linux-kernel@...r.kernel.org>, RCU <rcu@...r.kernel.org>,
"Paul E . McKenney" <paulmck@...nel.org>
Cc: Michal Hocko <mhocko@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Daniel Axtens <dja@...ens.net>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <neeraju@...eaurora.org>,
Joel Fernandes <joel@...lfernandes.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Theodore Y . Ts'o" <tytso@....edu>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Uladzislau Rezki <urezki@...il.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@...ymobile.com>
Subject: [PATCH v1 3/5] kvfree_rcu: Rename rcu_invoke_kfree_bulk_callback
The purpose of renaming is to have one common trace event
for APIs which use a special "bulk" form to release memory.
In our case we have kfree_bulk() and vfree_bulk(). It does
not make sense to implement two separate trace events which
would be identical expect for their names.
Rename it to "rcu_invoke_free_bulk_callback" and use it as
one trace event for both bulk API's.
Signed-off-by: Uladzislau Rezki (Sony) <urezki@...il.com>
---
include/trace/events/rcu.h | 4 ++--
kernel/rcu/tree.c | 16 +++++++++-------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 918585d85af9..0855cb35ae4e 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -681,11 +681,11 @@ TRACE_EVENT_RCU(rcu_invoke_kvfree_callback,
/*
* Tracepoint for the invocation of a single RCU callback of the special
- * kfree_bulk() form. The first argument is the RCU flavor, the second
+ * "free bulk" form. The first argument is the RCU flavor, the second
* argument is a number of elements in array to free, the third is an
* address of the array holding nr_records entries.
*/
-TRACE_EVENT_RCU(rcu_invoke_kfree_bulk_callback,
+TRACE_EVENT_RCU(rcu_invoke_free_bulk_callback,
TP_PROTO(const char *rcuname, unsigned long nr_records, void **p),
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 6bf170d01cd5..e44d6f8c56f0 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3305,16 +3305,18 @@ static void kfree_rcu_work(struct work_struct *work)
debug_rcu_bhead_unqueue(bkvhead[i]);
rcu_lock_acquire(&rcu_callback_map);
- if (i == 0) { // kmalloc() / kfree().
- trace_rcu_invoke_kfree_bulk_callback(
- rcu_state.name, bkvhead[i]->nr_records,
- bkvhead[i]->records);
+ trace_rcu_invoke_free_bulk_callback(
+ rcu_state.name, bkvhead[i]->nr_records,
+ bkvhead[i]->records);
+
+ if (i == 0) // kmalloc() / kfree().
kfree_bulk(bkvhead[i]->nr_records,
bkvhead[i]->records);
- } else { // vmalloc() / vfree().
- vfree_bulk(bkvhead[i]->nr_records, bkvhead[i]->records);
- }
+ else // vmalloc() / vfree().
+ vfree_bulk(bkvhead[i]->nr_records,
+ bkvhead[i]->records);
+
rcu_lock_release(&rcu_callback_map);
raw_spin_lock_irqsave(&krcp->lock, flags);
--
2.20.1
Powered by blists - more mailing lists