rcu/kvfree: Adjust names passed into trace functions

Currently trace functions are supplied with "rcu_state.name"
member which is located in the structure. The problem is that
the "rcu_state" structure variable is local and can not be
accessed from another place.

To address this, this preparation patch passes "slab" string
as a first argument.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Acked-by: Hyeonggon Yoo <hyeonggon.yoo@sk.com>
Tested-by: Hyeonggon Yoo <hyeonggon.yoo@sk.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
This commit is contained in:
Uladzislau Rezki (Sony) 2024-12-12 19:02:06 +01:00 committed by Vlastimil Babka
parent d824ed707b
commit ba5cac52d0

View File

@ -3379,14 +3379,14 @@ kvfree_rcu_bulk(struct kfree_rcu_cpu *krcp,
rcu_lock_acquire(&rcu_callback_map); rcu_lock_acquire(&rcu_callback_map);
if (idx == 0) { // kmalloc() / kfree(). if (idx == 0) { // kmalloc() / kfree().
trace_rcu_invoke_kfree_bulk_callback( trace_rcu_invoke_kfree_bulk_callback(
rcu_state.name, bnode->nr_records, "slab", bnode->nr_records,
bnode->records); bnode->records);
kfree_bulk(bnode->nr_records, bnode->records); kfree_bulk(bnode->nr_records, bnode->records);
} else { // vmalloc() / vfree(). } else { // vmalloc() / vfree().
for (i = 0; i < bnode->nr_records; i++) { for (i = 0; i < bnode->nr_records; i++) {
trace_rcu_invoke_kvfree_callback( trace_rcu_invoke_kvfree_callback(
rcu_state.name, bnode->records[i], 0); "slab", bnode->records[i], 0);
vfree(bnode->records[i]); vfree(bnode->records[i]);
} }
@ -3417,7 +3417,7 @@ kvfree_rcu_list(struct rcu_head *head)
next = head->next; next = head->next;
debug_rcu_head_unqueue((struct rcu_head *)ptr); debug_rcu_head_unqueue((struct rcu_head *)ptr);
rcu_lock_acquire(&rcu_callback_map); rcu_lock_acquire(&rcu_callback_map);
trace_rcu_invoke_kvfree_callback(rcu_state.name, head, offset); trace_rcu_invoke_kvfree_callback("slab", head, offset);
if (!WARN_ON_ONCE(!__is_kvfree_rcu_offset(offset))) if (!WARN_ON_ONCE(!__is_kvfree_rcu_offset(offset)))
kvfree(ptr); kvfree(ptr);