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 +, Valentin Schneider wrote: >> On 22/03/23 15:04, Peter Zijlstra wrote: >> > @@ -798,14 +794,20 @@ static void smp_call_function_many_cond( >> >} >> > >> >/* >> > + * Trace each sm

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

2023-03-23 Thread Peter Zijlstra
On Thu, Mar 23, 2023 at 04:25:25PM +, Valentin Schneider wrote: > 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 > >

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 > func==generic_smp_call_function_sin

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

2023-03-22 Thread Peter Zijlstra
On Wed, Mar 22, 2023 at 06:22:28PM +, Valentin Schneider wrote: > On 22/03/23 18:22, Peter Zijlstra wrote: > >>hackbench-157 [001]10.894320: ipi_send_cpu: cpu=3 > >> callsite=check_preempt_curr+0x37 callback=0x0 > > > > Arguably we should be setting callback to scheduler

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 +, 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 now stateful, i.e. I need the fir

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

2023-03-22 Thread Peter Zijlstra
On Wed, Mar 22, 2023 at 05:01:13PM +, 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 now stateful, i.e. I need the first and last > events in a CSD stack to figure ou

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 +, 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 thing for *every* csd enqeued? >> >

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

2023-03-22 Thread Peter Zijlstra
On Wed, Mar 22, 2023 at 12:20:28PM +, 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 thing for *every* csd enqeued? > > It's true that any CSD enqueued on that CPU's

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 +, 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); >> } >> >> +static __always_inline v

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

2023-03-22 Thread Peter Zijlstra
On Tue, Mar 07, 2023 at 02:35:58PM +, 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); > } > > +static __always_inline void > +raw_smp_call_single_queue(int cpu, struc