Re: [RFC PATCH v2 5/8] irq_work: Trace self-IPIs sent via arch_irq_work_raise()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Valentin Schneider <vschneid@xxxxxxxxxx>
- Subject: Re: [RFC PATCH v2 5/8] irq_work: Trace self-IPIs sent via arch_irq_work_raise()
- From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
- Date: Thu, 17 Nov 2022 10:10:57 +0100
- Cc: linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-csky@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, "Paul E. McKenney" <paulmck@xxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>, Juri Lelli <juri.lelli@xxxxxxxxxx>, Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>, Marcelo Tosatti <mtosatti@xxxxxxxxxx>, Frederic Weisbecker <frederic@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>
- In-reply-to: <20221102183336.3120536-4-vschneid@redhat.com>
- References: <20221102182949.3119584-1-vschneid@redhat.com> <20221102183336.3120536-4-vschneid@redhat.com>
On Wed, Nov 02, 2022 at 06:33:33PM +0000, Valentin Schneider wrote:
> IPIs sent to remove CPUs via irq_work_queue_on() are now covered by
> trace_ipi_send_cpumask(), add another instance of the tracepoint to cover
> self-IPIs.
>
> Signed-off-by: Valentin Schneider <vschneid@xxxxxxxxxx>
> ---
> kernel/irq_work.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/irq_work.c b/kernel/irq_work.c
> index 7afa40fe5cc43..aec38c294ce68 100644
> --- a/kernel/irq_work.c
> +++ b/kernel/irq_work.c
> @@ -22,6 +22,8 @@
> #include <asm/processor.h>
> #include <linux/kasan.h>
>
> +#include <trace/events/ipi.h>
> +
> static DEFINE_PER_CPU(struct llist_head, raised_list);
> static DEFINE_PER_CPU(struct llist_head, lazy_list);
> static DEFINE_PER_CPU(struct task_struct *, irq_workd);
> @@ -74,6 +76,16 @@ void __weak arch_irq_work_raise(void)
> */
> }
>
> +static inline void irq_work_raise(struct irq_work *work)
__always_inline, unless you want to occasionally only see it point to
__irq_work_queue_local().
> +{
> + if (trace_ipi_send_cpumask_enabled() && arch_irq_work_has_interrupt()) {
> + trace_ipi_send_cpumask(cpumask_of(smp_processor_id()),
> + _RET_IP_,
> + work->func);
}
> +
> + arch_irq_work_raise();
> +}
> +
> /* Enqueue on current CPU, work must already be claimed and preempt disabled */
> static void __irq_work_queue_local(struct irq_work *work)
> {
> @@ -99,7 +111,7 @@ static void __irq_work_queue_local(struct irq_work *work)
>
> /* If the work is "lazy", handle it from next tick if any */
> if (!lazy_work || tick_nohz_tick_stopped())
> - arch_irq_work_raise();
> + irq_work_raise(work);
> }
>
> /* Enqueue the irq work @work on the current CPU */
> --
> 2.31.1
>
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]