Re: [PATCH v4 5/5] sched: rename SD_SHARE_PKG_RESOURCES to SD_SHARE_LLC

2024-02-08 Thread Valentin Schneider
uggested-by: Valentin Schneider > Signed-off-by: Alex Shi AFAICT it's just missing the below replacement (I've stretched the comments to go up to 80 chars while at it), otherwise LGTM. Reviewed-by: Valentin Schneider --- diff --git a/kernel/sched/topology.c b/kernel/sched/topolo

Re: [RFC][PATCH] sched: Rename DIE domain

2023-07-12 Thread Valentin Schneider
> FWIW I don't care much about the actual name. There are some stray references to DIE in comments - see below. Bit funny to see: - * - Package (DIE) + * - Package (PKG) With that: Acked-by: Valentin Schneider --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a80a73909dc

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-06 Thread Valentin Schneider
On 06/04/23 15:38, Peter Zijlstra wrote: > On Wed, Apr 05, 2023 at 01:45:02PM +0100, Valentin Schneider wrote: >> >> I've been hacking on something like this (CSD deferral for NOHZ-full), >> and unfortunately this uses the CPU-local cfd_data storage thing, which

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Valentin Schneider
On 05/04/23 14:05, Frederic Weisbecker wrote: > static void smp_call_function_many_cond(const struct cpumask *mask, > smp_call_func_t func, void *info, > @@ -946,10 +948,13 @@ static void smp_call_function_many_cond(const struct > cpumask *mask, > #endif >

Re: [PATCH v5 7/7] sched, smp: Trace smp callback causing an IPI

2023-03-23 Thread Valentin Schneider
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( >> >} >> > >> >

Re: [PATCH v5 7/7] sched, smp: Trace smp callback causing an IPI

2023-03-23 Thread Valentin Schneider
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 >

Re: [PATCH v5 7/7] sched, smp: Trace smp callback causing an IPI

2023-03-22 Thread Valentin Schneider
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

Re: [PATCH v5 7/7] sched, smp: Trace smp callback causing an IPI

2023-03-22 Thread Valentin Schneider
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

Re: [PATCH v5 7/7] sched, smp: Trace smp callback causing an IPI

2023-03-22 Thread Valentin Schneider
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(>node.u_flags, 0); >> } &

Re: [PATCH v5 1/7] trace: Add trace_ipi_send_cpumask()

2023-03-22 Thread Valentin Schneider
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

Re: [PATCH 2/2] powerpc: use node_has_cpus() instead of nr_cpus_node()

2023-03-15 Thread Valentin Schneider
On 21/02/23 18:50, Yury Norov wrote: > Use node_has_cpus() as more efficient alternative to nr_cpus_node() > where possible. > > Signed-off-by: Yury Norov Reviewed-by: Valentin Schneider

Re: [PATCH 1/2] sched/topology: introduce node_has_cpus() macro

2023-03-15 Thread Valentin Schneider
et bit found. > > This patch adds a node_has_cpus() macro to implement that. > > Signed-off-by: Yury Norov Reviewed-by: Valentin Schneider

[PATCH v5 7/7] sched, smp: Trace smp callback causing an IPI

2023-03-07 Thread Valentin Schneider
he 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/sched/smp.h | 2 +- ke

[PATCH v5 6/7] smp: reword smp call IPI comment

2023-03-07 Thread Valentin Schneider
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 llist_n

[PATCH v5 5/7] treewide: Trace IPIs sent via smp_send_reschedule()

2023-03-07 Thread Valentin Schneider
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

[PATCH v5 4/7] irq_work: Trace self-IPIs sent via arch_irq_work_raise()

2023-03-07 Thread Valentin Schneider
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

[PATCH v5 3/7] smp: Trace IPIs sent via arch_send_call_function_ipi_mask()

2023-03-07 Thread Valentin Schneider
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

[PATCH v5 2/7] sched, smp: Trace IPIs sent via send_call_function_single_ipi()

2023-03-07 Thread Valentin Schneider
__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 +++

[PATCH v5 1/7] trace: Add trace_ipi_send_cpumask()

2023-03-07 Thread Valentin Schneider
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

[PATCH v5 0/7] Generic IPI sending tracepoint

2023-03-07 Thread Valentin Schneider
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 using _RET_IP_. o Fixed linking failures due to not exporting smp_sen

Re: [PATCH v4 0/7] Generic IPI sending tracepoint

2023-02-14 Thread Valentin Schneider
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 I've

[PATCH v4 7/7] sched, smp: Trace smp callback causing an IPI

2023-01-19 Thread Valentin Schneider
he 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/sched/smp.h | 2 +- ke

[PATCH v4 6/7] smp: reword smp call IPI comment

2023-01-19 Thread Valentin Schneider
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 llist_n

[PATCH v4 5/7] treewide: Trace IPIs sent via smp_send_reschedule()

2023-01-19 Thread Valentin Schneider
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

[PATCH v4 4/7] irq_work: Trace self-IPIs sent via arch_irq_work_raise()

2023-01-19 Thread Valentin Schneider
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

[PATCH v4 3/7] smp: Trace IPIs sent via arch_send_call_function_ipi_mask()

2023-01-19 Thread Valentin Schneider
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

[PATCH v4 1/7] trace: Add trace_ipi_send_cpumask()

2023-01-19 Thread Valentin Schneider
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

[PATCH v4 2/7] sched, smp: Trace IPIs sent via send_call_function_single_ipi()

2023-01-19 Thread Valentin Schneider
__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 +++

[PATCH v4 0/7] Generic IPI sending tracepoint

2023-01-19 Thread Valentin Schneider
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: 3e0f952a905ce sched, smp: Trace IPIs sent via send_ca

Re: [PATCH v3 3/8] sched, smp: Trace IPIs sent via send_call_function_single_ipi()

2023-01-09 Thread Valentin Schneider
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

Re: [PATCH v3 6/8] treewide: Trace IPIs sent via smp_send_reschedule()

2023-01-09 Thread Valentin Schneider
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 >

[PATCH v3 8/8] sched, smp: Trace smp callback causing an IPI

2022-12-02 Thread Valentin Schneider
he 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/sched/smp.h | 2 +- ke

[PATCH v3 7/8] smp: reword smp call IPI comment

2022-12-02 Thread Valentin Schneider
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 llist_n

[PATCH v3 6/8] treewide: Trace IPIs sent via smp_send_reschedule()

2022-12-02 Thread Valentin Schneider
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

[PATCH v3 3/8] sched, smp: Trace IPIs sent via send_call_function_single_ipi()

2022-12-02 Thread Valentin Schneider
__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

[PATCH v3 5/8] irq_work: Trace self-IPIs sent via arch_irq_work_raise()

2022-12-02 Thread Valentin Schneider
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

[PATCH v3 4/8] smp: Trace IPIs sent via arch_send_call_function_ipi_mask()

2022-12-02 Thread Valentin Schneider
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

[PATCH v3 2/8] trace: Add trace_ipi_send_cpumask()

2022-12-02 Thread Valentin Schneider
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

[PATCH v3 1/8] DO-NOT-MERGE: tracing: Add __cpumask to denote a trace event field that is a cpumask_t

2022-12-02 Thread Valentin Schneider
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

[PATCH v3 0/8] Generic IPI sending tracepoint

2022-12-02 Thread Valentin Schneider
_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_ipi() smp: Trace IPIs sent via arch_send_cal

Re: [RFC PATCH v2 8/8] sched, smp: Trace smp callback causing an IPI

2022-11-17 Thread Valentin Schneider
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 > >

Re: [RFC PATCH v2 6/8] treewide: Trace IPIs sent via smp_send_reschedule()

2022-11-17 Thread Valentin Schneider
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

Re: [RFC PATCH v2 4/8] smp: Trace IPIs sent via arch_send_call_function_ipi_mask()

2022-11-17 Thread Valentin Schneider
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

[RFC PATCH v2 8/8] sched, smp: Trace smp callback causing an IPI

2022-11-02 Thread Valentin Schneider
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 -

[RFC PATCH v2 7/8] smp: reword smp call IPI comment

2022-11-02 Thread Valentin Schneider
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 llist_n

[RFC PATCH v2 6/8] treewide: Trace IPIs sent via smp_send_reschedule()

2022-11-02 Thread Valentin Schneider
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

[RFC PATCH v2 5/8] irq_work: Trace self-IPIs sent via arch_irq_work_raise()

2022-11-02 Thread Valentin Schneider
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

[RFC PATCH v2 4/8] smp: Trace IPIs sent via arch_send_call_function_ipi_mask()

2022-11-02 Thread Valentin Schneider
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

[RFC PATCH v2 3/8] sched, smp: Trace IPIs sent via send_call_function_single_ipi()

2022-11-02 Thread Valentin Schneider
__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

[RFC PATCH v2 2/8] trace: Add trace_ipi_send_cpumask()

2022-11-02 Thread Valentin Schneider
allback. 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

[RFC PATCH v2 1/8] DO-NOT-MERGE: tracing: Add __cpumask to denote a trace event field that is a cpumask_t

2022-11-02 Thread Valentin Schneider
k use, but 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

[RFC PATCH v2 0/8] Generic IPI sending tracepoint

2022-11-02 Thread Valentin Schneider
ature 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 to denote a trace event field t

Re: [RFC PATCH 0/5] Generic IPI sending tracepoint

2022-10-11 Thread Valentin Schneider
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

Re: [RFC PATCH 0/5] Generic IPI sending tracepoint

2022-10-11 Thread Valentin Schneider
+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

Re: [RFC PATCH 4/5] irq_work: Trace calls to arch_irq_work_raise()

2022-10-11 Thread Valentin Schneider
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(

[RFC PATCH 5/5] treewide: Rename and trace arch-definitions of smp_send_reschedule()

2022-10-07 Thread Valentin Schneider
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

[RFC PATCH 4/5] irq_work: Trace calls to arch_irq_work_raise()

2022-10-07 Thread Valentin Schneider
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(+), 1

[RFC PATCH 3/5] smp: Add a multi-CPU variant to send_call_function_single_ipi()

2022-10-07 Thread Valentin Schneider
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

[RFC PATCH 2/5] sched, smp: Trace send_call_function_single_ipi()

2022-10-07 Thread Valentin Schneider
__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

[RFC PATCH 1/5] trace: Add trace_ipi_send_{cpu, cpumask}

2022-10-07 Thread Valentin Schneider
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

[RFC PATCH 0/5] Generic IPI sending tracepoint

2022-10-07 Thread Valentin Schneider
ng 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, smp: Trace send_call_function_sin

Re: [PATCH v2 3/5] powerpc: Use preemption model accessors

2021-11-22 Thread Valentin Schneider
On 16/11/21 14:41, Christophe Leroy wrote: > Le 10/11/2021 à 21:24, Valentin Schneider a écrit : >> Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual >> preemption model of the live kernel. Use the newly-introduced accessors >> instead. > > Is t

Re: [PATCH v2 2/5] preempt/dynamic: Introduce preempt mode accessors

2021-11-22 Thread Valentin Schneider
On 16/11/21 14:29, Christophe Leroy wrote: > Le 10/11/2021 à 21:24, Valentin Schneider a écrit : >> CONFIG_PREEMPT{_NONE, _VOLUNTARY} designate either: >> o The build-time preemption model when !PREEMPT_DYNAMIC >> o The default boot-time preemption model when PREEMPT_DYNAMIC &

Re: [PATCH v2 3/5] powerpc: Use preemption model accessors

2021-11-15 Thread Valentin Schneider
Doh, thought I had sent this one out already... On 11/11/21 15:55, Michael Ellerman wrote: > Valentin Schneider writes: >> Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual >> preemption model of the live kernel. Use the newly-introduced acces

Re: [PATCH v2 4/5] kscan: Use preemption model accessors

2021-11-11 Thread Valentin Schneider
On 11/11/21 10:11, Marco Elver wrote: > Subject s/kscan/kcsan/ > Woops... > On Wed, Nov 10, 2021 at 08:24PM +, Valentin Schneider wrote: >> Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual >> preemption model of the live kernel. Use the newly

Re: [PATCH v2 2/5] preempt/dynamic: Introduce preempt mode accessors

2021-11-11 Thread Valentin Schneider
On 11/11/21 11:32, Mike Galbraith wrote: > On Thu, 2021-11-11 at 10:36 +0100, Marco Elver wrote: >> I guess the question is if is_preempt_full() should be true also if >> is_preempt_rt() is true? > > That's what CONFIG_PREEMPTION is. More could follow, but it was added > to allow multiple models

Re: [PATCH v2 2/5] preempt/dynamic: Introduce preempt mode accessors

2021-11-11 Thread Valentin Schneider
On 11/11/21 09:54, Marco Elver wrote: > On Wed, Nov 10, 2021 at 08:24PM +0000, Valentin Schneider wrote: > [...] >> +#ifdef CONFIG_PREEMPT_DYNAMIC >> + >> +extern bool is_preempt_none(void); >> +extern bool is_preempt_voluntary(void); >> +extern bool i

[PATCH v2 5/5] ftrace: Use preemption model accessors for trace header printout

2021-11-10 Thread Valentin Schneider
Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual preemption model of the live kernel. Use the newly-introduced accessors instead. Signed-off-by: Valentin Schneider --- kernel/trace/trace.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git

[PATCH v2 4/5] kscan: Use preemption model accessors

2021-11-10 Thread Valentin Schneider
Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual preemption model of the live kernel. Use the newly-introduced accessors instead. Signed-off-by: Valentin Schneider --- kernel/kcsan/kcsan_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v2 3/5] powerpc: Use preemption model accessors

2021-11-10 Thread Valentin Schneider
Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual preemption model of the live kernel. Use the newly-introduced accessors instead. sched_init() -> preempt_dynamic_init() happens way before IRQs are set up, so this should be fine. Signed-off-by: Valentin Schnei

[PATCH v2 2/5] preempt/dynamic: Introduce preempt mode accessors

2021-11-10 Thread Valentin Schneider
by the "preempt=foo" cmdline parameter. Introduce a set of helpers to determine the actual preemption mode used by the live kernel. Suggested-by: Marco Elver Signed-off-by: Valentin Schneider --- include/linux/sched.h | 16 kernel/sched/core.c | 11 +++ 2 files c

[PATCH v2 1/5] preempt: Restore preemption model selection configs

2021-11-10 Thread Valentin Schneider
tream configs should by now all be depending / selected by CONFIG_PREEMPTION rather than CONFIG_PREEMPT, so only a few sites need patching up. Signed-off-by: Valentin Schneider --- include/linux/kernel.h | 2 +- include/linux/vermagic.h | 2 +- init/Makefile| 2 +- kernel/Kc

[PATCH v2 0/5] preempt: PREEMPT vs PREEMPT_DYNAMIC configs fixup

2021-11-10 Thread Valentin Schneider
: http://lore.kernel.org/r/20211105104035.3112162-1-valentin.schnei...@arm.com v1.5: http://lore.kernel.org/r/20211109151057.3489223-1-valentin.schnei...@arm.com This v2 is completely different from v1, so I felt like I could get away without writing a version changelog... Cheers, Valentin Valentin

Re: [PATCH] powerpc/smp: do not decrement idle task preempt count in CPU offline

2021-10-15 Thread Valentin Schneider
eempt_count being messed up when hot-unplugging a CPU, which leads to fireworks during hotplug (IOW I didn't test my last patch against hotplug - my bad!) Reviewed-by: Valentin Schneider > Tested with pseries and powernv in qemu, and pseries on PowerVM. > > Fixes: 2c669ef6979c (&quo

Re: [PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions

2021-10-08 Thread Valentin Schneider
On 09/10/21 01:37, Barry Song wrote: > On Sat, Oct 9, 2021 at 12:54 AM Valentin Schneider > wrote: >> >> Barry recently introduced a new CONFIG_SCHED_CLUSTER, and discussions >> around that highlighted that every architecture redefines its own help text >> and dep

[PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions

2021-10-08 Thread Valentin Schneider
untogglable. Suggested-by: Barry Song <21cn...@gmail.com> Signed-off-by: Valentin Schneider --- arch/arm/Kconfig | 18 ++ arch/arm64/Kconfig | 26 +++--- arch/ia64/Kconfig| 9 + arch/mips/Kconfig| 10 +- arch/parisc/Kconfig

[PATCH 1/2] sched: Move Kconfig.preempt to sched/Kconfig

2021-10-08 Thread Valentin Schneider
Kconfig.preempt already contains more than just preemption configs (see CONFIG_SCHED_CORE), and a subsequent patch will introduce more scheduler-specific configs. Move the file to the scheduler directory. Suggested-by: Peter Zijlstra Signed-off-by: Valentin Schneider --- init/Kconfig

[PATCH 0/2] sched: cleanup CONFIG_SCHED_MC & friends

2021-10-08 Thread Valentin Schneider
of Peter's queue: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git -b sched/next Patches are also available at: https://git.gitlab.arm.com/linux-arm/linux-vs.git -b mainline/sched/topo_kconfig_cleanup Cheers, Valentin Valentin Schneider (2): sched: Move Kconfig.preempt to sched

Re: [PATCH v2 1/2] sched/topology: Skip updating masks for non-online nodes

2021-08-16 Thread Valentin Schneider
On 16/08/21 16:03, Srikar Dronamraju wrote: >> >> Your version is much much better than mine. >> And I have verified that it works as expected. >> >> > > Hey Peter/Valentin > > Are we waiting for any more feedback/testing for this? > I'm not overly fond of that last one, but AFAICT the only

Re: [PATCH v2 1/2] sched/topology: Skip updating masks for non-online nodes

2021-08-09 Thread Valentin Schneider
On 09/08/21 12:22, Srikar Dronamraju wrote: > * Valentin Schneider [2021-08-08 16:56:47]: >> Wait, doesn't the distance matrix (without any offline node) say >> >> distance(0, 3) == 40 >> >> ? We should have at the very least: >> >> node 0 1

Re: [PATCH v2 1/2] sched/topology: Skip updating masks for non-online nodes

2021-08-08 Thread Valentin Schneider
A bit late, but technically the week isn't over yet! :D On 23/07/21 20:09, Srikar Dronamraju wrote: > * Valentin Schneider [2021-07-13 17:32:14]: >> Now, let's take examples from your cover letter: >> >> node distances: >> node 0 1 2 3 4 5 6 7 &g

Re: [PATCH v2 1/2] sched/topology: Skip updating masks for non-online nodes

2021-08-04 Thread Valentin Schneider
On 04/08/21 15:31, Srikar Dronamraju wrote: > * Srikar Dronamraju [2021-07-23 20:09:14]: > >> * Valentin Schneider [2021-07-13 17:32:14]: >> >> > On 12/07/21 18:18, Srikar Dronamraju wrote: >> > > Hi Valentin, >> > > >> > >>

Re: [PATCH v2 1/2] sched/topology: Skip updating masks for non-online nodes

2021-07-13 Thread Valentin Schneider
On 12/07/21 18:18, Srikar Dronamraju wrote: > Hi Valentin, > >> On 01/07/21 09:45, Srikar Dronamraju wrote: >> > @@ -1891,12 +1894,30 @@ void sched_init_numa(void) >> > void sched_domains_numa_masks_set(unsigned int cpu) >> > { >> >> Hmph, so we're playing games with masks of offline nodes - is

[PATCH] powerpc: preempt: Don't touch the idle task's preempt_count during hotplug

2021-07-07 Thread Valentin Schneider
. Get rid of this preempt_count write. Cc: Guenter Roeck Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") Reported-by: Bharata B Rao Signed-off-by: Valentin Schneider --- arch/powerpc/platforms/cell/smp.c| 3 --- arch/powerpc/platforms/pserie

Re: [PATCH v2 1/2] sched/topology: Skip updating masks for non-online nodes

2021-07-01 Thread Valentin Schneider
On 01/07/21 09:45, Srikar Dronamraju wrote: > @@ -1891,12 +1894,30 @@ void sched_init_numa(void) > void sched_domains_numa_masks_set(unsigned int cpu) > { > int node = cpu_to_node(cpu); > - int i, j; > + int i, j, empty; > > + empty =

Re: PowerPC guest getting "BUG: scheduling while atomic" on linux-next-20210623 during secondary CPUs bringup

2021-06-25 Thread Valentin Schneider
On 25/06/21 09:28, Peter Zijlstra wrote: > On Fri, Jun 25, 2021 at 11:16:08AM +0530, Srikar Dronamraju wrote: >> Bharata, >> >> I think the regression is due to Commit f1a0a376ca0c ("sched/core: >> Initialize the idle task with preemption disabled") > > So that extra preempt_disable() that got

Re: [PATCH 1/3] sched/topology: Allow archs to populate distance map

2021-05-25 Thread Valentin Schneider
On 24/05/21 21:48, Srikar Dronamraju wrote: > * Valentin Schneider [2021-05-24 15:16:09]: >> Ok so from your arch you can figure out the *size* of the set of unique >> distances, but not the individual node_distance(a, b)... That's quite >> unfortunate. > > Yes, thats

Re: [PATCH 2/3] powerpc/numa: Populate distance map correctly

2021-05-24 Thread Valentin Schneider
On 20/05/21 21:14, Srikar Dronamraju wrote: > +int arch_populate_distance_map(unsigned long *distance_map) > +{ > + int i; > + int distance = LOCAL_DISTANCE; > + > + bitmap_set(distance_map, distance, 1); > + > + if (!form1_affinity) { > + bitmap_set(distance_map,

Re: [PATCH 1/3] sched/topology: Allow archs to populate distance map

2021-05-24 Thread Valentin Schneider
On 21/05/21 14:58, Srikar Dronamraju wrote: > * Peter Zijlstra [2021-05-21 10:14:10]: > >> On Fri, May 21, 2021 at 08:08:02AM +0530, Srikar Dronamraju wrote: >> > * Peter Zijlstra [2021-05-20 20:56:31]: >> > >> > > On Thu, May 20, 2021 at 09:14:25PM +0530, Srikar Dronamraju wrote: >> > > >

[PATCH] sched: Initialize the idle task with preemption disabled

2021-05-12 Thread Valentin Schneider
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 --- arch/alpha

Re: [RFC/PATCH] powerpc/smp: Add SD_SHARE_PKG_RESOURCES flag to MC sched-domain

2021-04-12 Thread Valentin Schneider
On 12/04/21 10:37, Mel Gorman wrote: > On Mon, Apr 12, 2021 at 11:54:36AM +0530, Srikar Dronamraju wrote: >> * Gautham R. Shenoy [2021-04-02 11:07:54]: >> >> > >> > To remedy this, this patch proposes that the LLC be moved to the MC >> > level which is a group of cores in one half of the chip. >>

Re: [PATCH 2/2] powerpc/topology: Override cpu_smt_mask

2020-08-04 Thread Valentin Schneider
On 04/08/20 11:46, pet...@infradead.org wrote: > On Tue, Aug 04, 2020 at 09:03:07AM +0530, Srikar Dronamraju wrote: >> On Power9 a pair of cores can be presented by the firmware as a big-core >> for backward compatibility reasons, with 4 threads per (small) core and 8 >> threads per big-core.

Re: [PATCH v4 09/10] Powerpc/smp: Create coregroup domain

2020-07-30 Thread Valentin Schneider
(+Cc Morten) On 29/07/20 07:13, Srikar Dronamraju wrote: > * Valentin Schneider [2020-07-28 16:03:11]: > > Hi Valentin, > > Thanks for looking into the patches. > >> On 27/07/20 06:32, Srikar Dronamraju wrote: >> > Add percpu coregroup maps and

Re: [PATCH v4 09/10] Powerpc/smp: Create coregroup domain

2020-07-28 Thread Valentin Schneider
Hi, On 27/07/20 06:32, Srikar Dronamraju wrote: > Add percpu coregroup maps and masks to create coregroup domain. > If a coregroup doesn't exist, the coregroup domain will be degenerated > in favour of SMT/CACHE domain. > So there's at least one arm64 platform out there with the same "pairs of

Re: [PATCH 00/14] entry: preempt_schedule_irq() callers scrub

2019-03-12 Thread Valentin Schneider
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" >

[PATCH 08/14] powerpc: entry: Remove unneeded need_resched() loop

2019-03-12 Thread Valentin Schneider
Since the enabling and disabling of IRQs within preempt_schedule_irq() is contained in a need_resched() loop, we don't need the outer arch code loop. Signed-off-by: Valentin Schneider Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org

[PATCH 00/14] entry: preempt_schedule_irq() callers scrub

2019-03-12 Thread Valentin Schneider
s32 - 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/core: Fix preempt_schedule() interrupt return comm