ild-tested on:
- h8300
- c6x
- powerpc
- mips
- nds32
- microblaze
- sparc
- xtensa
Thanks,
Valentin
[1]:
https://lore.kernel.org/lkml/20190131182339.9835-1-valentin.schnei...@arm.com/
[2]: https://lore.kernel.org/lkml/cc989920-a13b-d53b-db83-1584a7f53...@arm.com/
Valentin Schneider (14):
sched/
On 12/03/2019 18:03, Vineet Gupta wrote:
[...]
>> Regarding that loop, archs seem to fall in 3 categories:
>> A) Those that don't have the loop
>
> Please clarify that this is the right thing to do (since core code already
> has the
> loop) hence no fixing is required for this "category"
>
Righ
alize its
preempt_count to PREEMPT_DISABLED and leave it there. Do that, and remove
init_idle() from idle_thread_get().
Secondary startups were patched via coccinelle:
@begone@
@@
-preempt_disable();
...
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
Signed-off-by: Valentin Schneider
---
ch about the actual callback being sent via IPI, so there might be value
in exploding the single tracepoint into at least one variant for smp_calls.
Links
=
[1]: https://youtu.be/5gT57y4OzBM?t=14234
Valentin Schneider (5):
trace: Add trace_ipi_send_{cpu, cpumask}
sched, s
__ttwu_queue_wakelist() and irq_work_queue_on() "for free".
Signed-off-by: Valentin Schneider
---
arch/arm/kernel/smp.c | 3 ---
arch/arm64/kernel/smp.c | 1 -
kernel/sched/core.c | 7 +--
kernel/smp.c| 4
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git
trace_ipi_raise is unsuitable for generically tracing IPI sources; add a
variant of it that takes a callsite and a CPU. Define a macro helper for
handling IPIs sent to multiple CPUs.
Signed-off-by: Valentin Schneider
---
include/trace/events/ipi.h | 27 +++
1 file
Adding a tracepoint to send_call_function_single_ipi() covers
irq_work_queue_on() when the CPU isn't the local one - add a tracepoint to
irq_work_raise() to cover the other cases.
Signed-off-by: Valentin Schneider
---
kernel/irq_work.c | 12 +++-
1 file changed, 11 insertions(
This simply wraps around the arch function and prepends it with a
tracepoint, bringing parity with send_call_function_single_ipi().
Signed-off-by: Valentin Schneider
---
kernel/smp.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/smp.c b/kernel/smp.c
index
To be able to trace invocations of smp_send_reschedule(), rename the
arch-specific definitions of it to arch_smp_send_reschedule() and wrap it
into an smp_send_reschedule() that contains a tracepoint.
Signed-off-by: Valentin Schneider
---
arch/alpha/kernel/smp.c | 2 +-
arch/arc/kernel
On 08/10/22 15:34, Steven Rostedt wrote:
> On Fri, 7 Oct 2022 16:45:32 +0100
> Valentin Schneider wrote:
>> }
>>
>> +static inline void irq_work_raise(void)
>> +{
>> +if (arch_irq_work_has_interrupt())
>> +trace_ipi_send_cpu(_RET_IP
+Cc Douglas
On 07/10/22 17:01, Marcelo Tosatti wrote:
> Hi Valentin,
>
> On Fri, Oct 07, 2022 at 04:41:40PM +0100, Valentin Schneider wrote:
>> Background
>> ==
>>
>> As for the targeted CPUs, the existing tracepoint does export them, albeit i
On 11/10/22 18:22, Daniel Bristot de Oliveira wrote:
> On 10/11/22 18:17, Valentin Schneider wrote:
>> Thinking out loud, it makes way more sense to record a cpumask in the
>> tracepoint, but perhaps we could have a postprocessing step to transform
>> those into N events ea
the
comparison field requires it to be a scalar type whereas cpumask_t is a
structure (non-scalar). But everything works when making it a pointer.
Valentin added changes to remove the need of passing in "nr_bits" and the
__cpumask will always use nr_cpumask_bits as its size.
Reque
back.
Signed-off-by: Valentin Schneider
---
include/trace/events/ipi.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/include/trace/events/ipi.h b/include/trace/events/ipi.h
index 0be71dad6ec03..b1125dc27682c 100644
--- a/include/trace/events/ipi.h
+++ b/include/trace/e
__ttwu_queue_wakelist() and irq_work_queue_on() "for free".
Signed-off-by: Valentin Schneider
---
arch/arm/kernel/smp.c | 3 ---
arch/arm64/kernel/smp.c | 1 -
kernel/sched/core.c | 7 +--
kernel/smp.c| 4
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git
This simply wraps around the arch function and prepends it with a
tracepoint, similar to send_call_function_single_ipi().
Signed-off-by: Valentin Schneider
---
kernel/smp.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/smp.c b/kernel/smp.c
index
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
---
kernel/irq_work.c | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a
To be able to trace invocations of smp_send_reschedule(), rename the
arch-specific definitions of it to arch_smp_send_reschedule() and wrap it
into an smp_send_reschedule() that contains a tracepoint.
Signed-off-by: Valentin Schneider
[csky bits]
Acked-by: Guo Ren
---
arch/alpha/kernel/smp.c
the
tracepoint's static key can fetch.
a) creates redundant code, and b) is quite fragile due to requiring extra
care for "reentrant" functions (async SMP calls).
This implements a).
Signed-off-by: Valentin Schneider
---
kernel/irq_work.c | 2 ++
kernel/sched/core.c | 35
Signed-off-by: Valentin Schneider
---
kernel/smp.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/smp.c b/kernel/smp.c
index 44fa4b9b1f46b..b96579fe08f09 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -503,9 +503,10 @@ void __smp_call_single_queue(int cpu, struct ll
oint
o Changed tracepoint signature to include callback
o Changed tracepoint callsite field to void *; the parameter is still UL to save
up on casts due to using _RET_IP_.
o Fixed linking failures due to not exporting smp_send_reschedule()
Steven Rostedt (Google) (1):
tracing: Add __cpumask t
On 17/11/22 10:08, Peter Zijlstra wrote:
> On Wed, Nov 02, 2022 at 06:33:32PM +0000, Valentin Schneider wrote:
>> This simply wraps around the arch function and prepends it with a
>> tracepoint, similar to send_call_function_single_ipi().
>>
>> Signed-off-by: Valentin S
On 17/11/22 10:12, Peter Zijlstra wrote:
> On Wed, Nov 02, 2022 at 06:33:34PM +0000, Valentin Schneider wrote:
>
>> diff --git a/kernel/smp.c b/kernel/smp.c
>> index c4d561cf50d45..44fa4b9b1f46b 100644
>> --- a/kernel/smp.c
>> +++ b/kernel/smp.c
>> @@ -167,6 +1
On 17/11/22 15:12, Peter Zijlstra wrote:
> On Wed, Nov 02, 2022 at 06:33:36PM +0000, Valentin Schneider wrote:
> *yuck*
:-)
>
> How about something like so?
>
> ---
> --- a/kernel/irq_work.c
> +++ b/kernel/irq_work.c
> @@ -24,6 +24,8 @@
>
> #include
>
>
xed linking failures due to not exporting smp_send_reschedule()
Steven Rostedt (Google) (1):
tracing: Add __cpumask to denote a trace event field that is a
cpumask_t
Valentin Schneider (7):
trace: Add trace_ipi_send_cpumask()
sched, smp: Trace IPIs sent via send_call_function_single_i
nk: https://lkml.kernel.org/r/20221014080456.1d32b...@rorschach.local.home
Requested-by: Valentin Schneider
Reviewed-by: Valentin Schneider
Signed-off-by: Valentin Schneider
Signed-off-by: Steven Rostedt (Google)
---
include/trace/bpf_probe.h| 6
include/trace/perf.h
trace_ipi_raise() is unsuitable for generically tracing IPI sources due to
its "reason" argument being an uninformative string (on arm64 all you get
is "Function call interrupts" for SMP calls).
Add a variant of it that exports a target CPU, a callsite and a callback.
Sig
This simply wraps around the arch function and prepends it with a
tracepoint, similar to send_call_function_single_ipi().
Signed-off-by: Valentin Schneider
Reviewed-by: Steven Rostedt (Google)
---
kernel/smp.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel
__ttwu_queue_wakelist() and irq_work_queue_on() "for free".
Signed-off-by: Valentin Schneider
Reviewed-by: Steven Rostedt (Google)
---
arch/arm/kernel/smp.c | 3 ---
arch/arm64/kernel/smp.c | 1 -
kernel/sched/core.c | 7 +--
kernel/smp.c| 4
4 files changed, 9
IPIs sent to remote 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
Reviewed-by: Steven Rostedt (Google)
---
kernel/irq_work.c | 14 +-
1 file changed, 13
script:
@func_use@
@@
smp_send_reschedule(...);
@include@
@@
#include
@no_include depends on func_use && !include@
@@
#include <...>
+
+ #include
Signed-off-by: Valentin Schneider
[csky bits]
Acked-by: Guo Ren
---
arch/alpha/kernel/smp.c
Signed-off-by: Valentin Schneider
---
kernel/smp.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/smp.c b/kernel/smp.c
index 93b4386cd3096..821b5986721ac 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -495,9 +495,10 @@ void __smp_call_single_queue(int cpu, struct ll
tion that can take the related callback as
parameter without creating useless register pressure in the non-traced path
which only gains a (disabled) static branch.
Do the same thing for the multi IPI case.
Signed-off-by: Valentin Schneider
---
kernel/sched/core.c | 18 +++-
kernel/sche
On 08/01/23 20:17, Huacai Chen wrote:
> Hi, Valentin,
>
> On Fri, Dec 2, 2022 at 11:59 PM Valentin Schneider
> wrote:
>> @@ -83,7 +83,7 @@ extern void show_ipi_list(struct seq_file *p, int prec);
>> * it goes straight through and wastes no time serializing
>>
On 07/01/23 12:04, Ingo Molnar wrote:
> * Valentin Schneider wrote:
>
>> send_call_function_single_ipi() is the thing that sends IPIs at the bottom
>> of smp_call_function*() via either generic_exec_single() or
>> smp_call_function_many_cond(). Give it an IPI-related trac
calls).
-Add a variant of it that exports a target CPU, a callsite and a
callback.
+Add a variant of it that exports a target cpumask, a callsite and a
callback.
Signed-off-by: Valentin Schneider
Reviewed-by: Steven Rostedt (Google)
3: 17ccdc591aec9 ! 2
trace_ipi_raise() is unsuitable for generically tracing IPI sources due to
its "reason" argument being an uninformative string (on arm64 all you get
is "Function call interrupts" for SMP calls).
Add a variant of it that exports a target cpumask, a callsite and a callback.
Sig
__ttwu_queue_wakelist() and irq_work_queue_on() "for free".
Signed-off-by: Valentin Schneider
Reviewed-by: Steven Rostedt (Google)
Acked-by: Ingo Molnar
---
arch/arm/kernel/smp.c | 3 ---
arch/arm64/kernel/smp.c | 1 -
kernel/sched/core.c | 7 +--
kernel/smp.c| 4 +++
This simply wraps around the arch function and prepends it with a
tracepoint, similar to send_call_function_single_ipi().
Signed-off-by: Valentin Schneider
Reviewed-by: Steven Rostedt (Google)
---
kernel/smp.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel
script:
@func_use@
@@
smp_send_reschedule(...);
@include@
@@
#include
@no_include depends on func_use && !include@
@@
#include <...>
+
+ #include
Signed-off-by: Valentin Schneider
[csky bits]
Acked-by: Guo Ren
[riscv bits]
Acked-by: Palmer Dabbelt
---
arc
IPIs sent to remote 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
Reviewed-by: Steven Rostedt (Google)
---
kernel/irq_work.c | 14 +-
1 file changed, 13
Signed-off-by: Valentin Schneider
---
kernel/smp.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/smp.c b/kernel/smp.c
index 93b4386cd3096..821b5986721ac 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -495,9 +495,10 @@ void __smp_call_single_queue(int cpu, struct ll
tion that can take the related callback as
parameter without creating useless register pressure in the non-traced path
which only gains a (disabled) static branch.
Do the same thing for the multi IPI case.
Signed-off-by: Valentin Schneider
---
kernel/sched/core.c | 18 +++-
kernel/sche
Hey folks,
On 19/01/23 14:36, Valentin Schneider wrote:
> Patches
> ===
>
> o Patches 1-5 spread out the tracepoint across relevant sites.
> Patch 5 ends up sprinkling lots of #include which I'm
> not
> the biggest fan of, but is the least horrible solution
macro madness, split it into sched
and smp bits using some of Peter's suggestions
v1 -> v2
o Ditched single-CPU tracepoint
o Changed tracepoint signature to include callback
o Changed tracepoint callsite field to void *; the parameter is still UL to save
up on casts due to
trace_ipi_raise() is unsuitable for generically tracing IPI sources due to
its "reason" argument being an uninformative string (on arm64 all you get
is "Function call interrupts" for SMP calls).
Add a variant of it that exports a target cpumask, a callsite and a callback.
Sig
This simply wraps around the arch function and prepends it with a
tracepoint, similar to send_call_function_single_ipi().
Signed-off-by: Valentin Schneider
Reviewed-by: Steven Rostedt (Google)
---
kernel/smp.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel
__ttwu_queue_wakelist() and irq_work_queue_on() "for free".
Signed-off-by: Valentin Schneider
Reviewed-by: Steven Rostedt (Google)
Acked-by: Ingo Molnar
---
arch/arm/kernel/smp.c | 3 ---
arch/arm64/kernel/smp.c | 1 -
kernel/sched/core.c | 7 +--
kernel/smp.c| 4 +++
script:
@func_use@
@@
smp_send_reschedule(...);
@include@
@@
#include
@no_include depends on func_use && !include@
@@
#include <...>
+
+ #include
Signed-off-by: Valentin Schneider
[csky bits]
Acked-by: Guo Ren
[riscv bits]
Acked-by: Palmer Dabbelt
---
arc
IPIs sent to remote 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
Reviewed-by: Steven Rostedt (Google)
---
kernel/irq_work.c | 14 +-
1 file changed, 13
Signed-off-by: Valentin Schneider
---
kernel/smp.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/smp.c b/kernel/smp.c
index 93b4386cd3096..821b5986721ac 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -495,9 +495,10 @@ void __smp_call_single_queue(int cpu, struct ll
tion that can take the related callback as
parameter without creating useless register pressure in the non-traced path
which only gains a (disabled) static branch.
Do the same thing for the multi IPI case.
Signed-off-by: Valentin Schneider
---
kernel/sched/core.c | 18 +++-
kernel/sche
On 22/03/23 11:30, Peter Zijlstra wrote:
> On Wed, Mar 22, 2023 at 10:39:55AM +0100, Peter Zijlstra wrote:
>> On Tue, Mar 07, 2023 at 02:35:52PM +, Valentin Schneider wrote:
>> > +TRACE_EVENT(ipi_send_cpumask,
>> > +
>> > + TP_PROTO(const struct cpumask *c
On 22/03/23 10:53, Peter Zijlstra wrote:
> On Tue, Mar 07, 2023 at 02:35:58PM +0000, Valentin Schneider wrote:
>
>> @@ -477,6 +490,25 @@ static __always_inline void csd_unlock(struct
>> __call_single_data *csd)
>> smp_store_release(&csd->node.u_flags, 0);
>
On 22/03/23 15:04, Peter Zijlstra wrote:
> On Wed, Mar 22, 2023 at 12:20:28PM +0000, Valentin Schneider wrote:
>> On 22/03/23 10:53, Peter Zijlstra wrote:
>
>> > Hurmph... so we only really consume @func when we IPI. Would it not be
>> > more useful to trace this
On 22/03/23 18:22, Peter Zijlstra wrote:
> On Wed, Mar 22, 2023 at 05:01:13PM +0000, Valentin Schneider wrote:
>
>> > So I was thinking something like this:
>
>> Hm, this does get rid of the func being passed down the helpers, but this
>> means the trace events are
On 22/03/23 15:04, Peter Zijlstra wrote:
> @@ -798,14 +794,20 @@ static void smp_call_function_many_cond(
> }
>
> /*
> + * Trace each smp_function_call_*() as an IPI, actual IPIs
> + * will be traced with
> func==generic_smp_call_function_sin
On 23/03/23 18:41, Peter Zijlstra wrote:
> On Thu, Mar 23, 2023 at 04:25:25PM +0000, Valentin Schneider wrote:
>> On 22/03/23 15:04, Peter Zijlstra wrote:
>> > @@ -798,14 +794,20 @@ static void smp_call_function_many_cond(
>> >}
>> >
>> >
58 matches
Mail list logo