linux-stable/include/trace/events/csd.h
Leonardo Bras d090ec0df8 smp: Change function signatures to use call_single_data_t
call_single_data_t is a size-aligned typedef of struct __call_single_data.

This alignment is desirable in order to have smp_call_function*() avoid
bouncing an extra cacheline in case of an unaligned csd, given this
would hurt performance.

Since the removal of struct request->csd in commit 660e802c76
("blk-mq: use percpu csd to remote complete instead of per-rq csd") there
are no current users of smp_call_function*() with unaligned csd.

Change every 'struct __call_single_data' function parameter to
'call_single_data_t', so we have warnings if any new code tries to
introduce an smp_call_function*() call with unaligned csd.

Signed-off-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230831063129.335425-1-leobras@redhat.com
2023-09-13 14:59:24 +02:00

72 lines
1.5 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM csd
#if !defined(_TRACE_CSD_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_CSD_H
#include <linux/tracepoint.h>
TRACE_EVENT(csd_queue_cpu,
TP_PROTO(const unsigned int cpu,
unsigned long callsite,
smp_call_func_t func,
call_single_data_t *csd),
TP_ARGS(cpu, callsite, func, csd),
TP_STRUCT__entry(
__field(unsigned int, cpu)
__field(void *, callsite)
__field(void *, func)
__field(void *, csd)
),
TP_fast_assign(
__entry->cpu = cpu;
__entry->callsite = (void *)callsite;
__entry->func = func;
__entry->csd = csd;
),
TP_printk("cpu=%u callsite=%pS func=%ps csd=%p",
__entry->cpu, __entry->callsite, __entry->func, __entry->csd)
);
/*
* Tracepoints for a function which is called as an effect of smp_call_function.*
*/
DECLARE_EVENT_CLASS(csd_function,
TP_PROTO(smp_call_func_t func, call_single_data_t *csd),
TP_ARGS(func, csd),
TP_STRUCT__entry(
__field(void *, func)
__field(void *, csd)
),
TP_fast_assign(
__entry->func = func;
__entry->csd = csd;
),
TP_printk("func=%ps, csd=%p", __entry->func, __entry->csd)
);
DEFINE_EVENT(csd_function, csd_function_entry,
TP_PROTO(smp_call_func_t func, call_single_data_t *csd),
TP_ARGS(func, csd)
);
DEFINE_EVENT(csd_function, csd_function_exit,
TP_PROTO(smp_call_func_t func, call_single_data_t *csd),
TP_ARGS(func, csd)
);
#endif /* _TRACE_CSD_H */
/* This part must be outside protection */
#include <trace/define_trace.h>