[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJNi4rMfRmWoYdsyH6ibNKN8DSCL_DO8Wa08mWbe8t7vH21Dpw@mail.gmail.com>
Date: Thu, 27 Jun 2024 17:26:05 +0800
From: richard clark <richard.xnu.clark@...il.com>
To: Marc Zyngier <maz@...nel.org>, Mark Rutland <mark.rutland@....com>, will@...nel.org
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
"Russell King (Oracle)" <linux@...linux.org.uk>, Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Will smp_call_function_single(cpu, ...) broadcast IPI to all other cpus?
Hi,
There's a smp_call_function_single(10, ipi_cb_func, &data_info, 1)
called by the init function of my kmod, then I ipi traces this
smp_call_function_single(...) with below cmdline:
# echo 0 > /sys/kernel/debug/tracing/tracing_on; echo >
/sys/kernel/debug/tracing/trace; echo 'reason=="Function call
interrupts"' > /sys/kernel/debug/tracing/events/ipi/filter; echo 1 >
/sys/kernel/debug/tracing/events/ipi/ipi_raise/enable; echo 1 >
/sys/kernel/debug/tracing/events/ipi/ipi_entry/enable; echo 1 >
/sys/kernel/debug/tracing/tracing_on; taskset -c 0 insmod
/kmods/ipi_test.ko; echo 0 > /sys/kernel/debug/tracing/tracing_on;
echo 0 > /sys/kernel/debug/tracing/events/ipi/ipi_raise/enable; echo 0
> /sys/kernel/debug/tracing/events/ipi/ipi_entry/enable; echo >
/sys/kernel/debug/tracing/events/ipi/filter; cat
/sys/kernel/debug/tracing/trace
The trace output as below:
# tracer: nop
#
# entries-in-buffer/entries-written: 28/28 #P:12
#
# _-------=> irqs-off/BH-disabled
# / _------=> need-resched
# | / _-----=> need-resched-lazy
# || / _----=> hardirq/softirq
# ||| / _---=> preempt-depth
# |||| / _--=> preempt-lazy-depth
# ||||| / _-=> migrate-disable
# |||||| / delay
# TASK-PID CPU# ||||||| TIMESTAMP FUNCTION
# | | | ||||||| | |
<idle>-0 [009] dn.h2.. 555.400822: ipi_raise:
target_mask=00000000,00000002 (Function call interrupts)
<idle>-0 [001] d..h1.. 555.400832: ipi_entry:
(Function call interrupts)
insmod-1644 [000] ....1.. 555.401628: ipi_raise:
target_mask=00000000,00000ffe (Function call interrupts)
<idle>-0 [001] d..h1.. 555.401630: ipi_entry:
(Function call interrupts)
<idle>-0 [009] d..h1.. 555.401631: ipi_entry:
(Function call interrupts)
<idle>-0 [011] d..h1.. 555.401633: ipi_entry:
(Function call interrupts)
<idle>-0 [003] d..h1.. 555.401633: ipi_entry:
(Function call interrupts)
<idle>-0 [008] d..h1.. 555.401633: ipi_entry:
(Function call interrupts)
<idle>-0 [002] d..h1.. 555.401634: ipi_entry:
(Function call interrupts)
<idle>-0 [010] d..h1.. 555.401634: ipi_entry:
(Function call interrupts)
<idle>-0 [004] d..h1.. 555.401635: ipi_entry:
(Function call interrupts)
<idle>-0 [005] d..h1.. 555.401635: ipi_entry:
(Function call interrupts)
<idle>-0 [006] d..h1.. 555.401635: ipi_entry:
(Function call interrupts)
<idle>-0 [007] d..h1.. 555.401635: ipi_entry:
(Function call interrupts)
insmod-1644 [000] ....1.. 555.401643: ipi_raise:
target_mask=00000000,00000ffe (Function call interrupts)
<idle>-0 [001] d..h1.. 555.401644: ipi_entry:
(Function call interrupts)
<idle>-0 [002] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [003] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [004] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [006] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [005] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [007] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [008] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [009] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [010] d..h1.. 555.401645: ipi_entry:
(Function call interrupts)
<idle>-0 [011] d..h1.. 555.401646: ipi_entry:
(Function call interrupts)
insmod-1644 [000] ....1.. 555.401908: ipi_raise:
target_mask=00000000,00000400 (Function call interrupts)
<idle>-0 [010] d..h1.. 555.401911: ipi_entry:
(Function call interrupts)
I am curious why there're two IPI broadcasts to all the other
cpus(1-11) before the real smp_call_function_single(10) trace
event(the last two lines of the above trace output), any comments
about that?
Powered by blists - more mailing lists