Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-25 Thread Nadav Amit
> On Jul 25, 2019, at 5:36 AM, Thomas Gleixner wrote: > > On Mon, 22 Jul 2019, Nadav Amit wrote: >>> On Jul 22, 2019, at 11:51 AM, Thomas Gleixner wrote: >>> void on_each_cpu(void (*func) (void *info), void *info, int wait) >>> { >>> unsigned long flags; >>> >>> preempt_disable();

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-25 Thread Thomas Gleixner
On Mon, 22 Jul 2019, Nadav Amit wrote: > > On Jul 22, 2019, at 11:51 AM, Thomas Gleixner wrote: > > void on_each_cpu(void (*func) (void *info), void *info, int wait) > > { > >unsigned long flags; > > > >preempt_disable(); > > smp_call_function(func, info, wait); > > > >

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Peter Zijlstra
On Mon, Jul 22, 2019 at 06:41:44PM +, Nadav Amit wrote: > > On Jul 22, 2019, at 11:16 AM, Peter Zijlstra wrote: > > > > On Fri, Jul 19, 2019 at 11:23:06AM -0700, Dave Hansen wrote: > >> On 7/18/19 5:58 PM, Nadav Amit wrote: > >>> @@ -624,16 +622,11 @@ EXPORT_SYMBOL(on_each_cpu); > >>> void

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Peter Zijlstra
On Mon, Jul 22, 2019 at 06:34:22PM +, Nadav Amit wrote: > > On Jul 22, 2019, at 11:21 AM, Peter Zijlstra wrote: > > > > On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote: > >> +/* > >> + * Call a function on all processors. May be used during early boot while > >> + *

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Nadav Amit
> On Jul 22, 2019, at 11:51 AM, Thomas Gleixner wrote: > > On Mon, 22 Jul 2019, Nadav Amit wrote: >>> On Jul 22, 2019, at 11:37 AM, Thomas Gleixner wrote: >>> >>> On Mon, 22 Jul 2019, Peter Zijlstra wrote: >>> On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote: > +/* > +

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Thomas Gleixner
On Mon, 22 Jul 2019, Nadav Amit wrote: > > On Jul 22, 2019, at 11:37 AM, Thomas Gleixner wrote: > > > > On Mon, 22 Jul 2019, Peter Zijlstra wrote: > > > >> On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote: > >>> +/* > >>> + * Call a function on all processors. May be used during

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Nadav Amit
> On Jul 22, 2019, at 11:16 AM, Peter Zijlstra wrote: > > On Fri, Jul 19, 2019 at 11:23:06AM -0700, Dave Hansen wrote: >> On 7/18/19 5:58 PM, Nadav Amit wrote: >>> @@ -624,16 +622,11 @@ EXPORT_SYMBOL(on_each_cpu); >>> void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func, >>>

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Nadav Amit
> On Jul 22, 2019, at 11:37 AM, Thomas Gleixner wrote: > > On Mon, 22 Jul 2019, Peter Zijlstra wrote: > >> On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote: >>> +/* >>> + * Call a function on all processors. May be used during early boot while >>> + * early_boot_irqs_disabled is set.

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Thomas Gleixner
On Mon, 22 Jul 2019, Peter Zijlstra wrote: > On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote: > > +/* > > + * Call a function on all processors. May be used during early boot while > > + * early_boot_irqs_disabled is set. > > + */ > > +static inline void on_each_cpu(smp_call_func_t

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Nadav Amit
> On Jul 22, 2019, at 11:21 AM, Peter Zijlstra wrote: > > On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote: >> +/* >> + * Call a function on all processors. May be used during early boot while >> + * early_boot_irqs_disabled is set. >> + */ >> +static inline void

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Peter Zijlstra
On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote: > +/* > + * Call a function on all processors. May be used during early boot while > + * early_boot_irqs_disabled is set. > + */ > +static inline void on_each_cpu(smp_call_func_t func, void *info, int wait) > +{ > +

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-22 Thread Peter Zijlstra
On Fri, Jul 19, 2019 at 11:23:06AM -0700, Dave Hansen wrote: > On 7/18/19 5:58 PM, Nadav Amit wrote: > > @@ -624,16 +622,11 @@ EXPORT_SYMBOL(on_each_cpu); > > void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func, > > void *info, bool wait) > > { > > - int

Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-19 Thread Dave Hansen
On 7/18/19 5:58 PM, Nadav Amit wrote: > @@ -624,16 +622,11 @@ EXPORT_SYMBOL(on_each_cpu); > void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func, > void *info, bool wait) > { > - int cpu = get_cpu(); > + preempt_disable(); > > -

[PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

2019-07-18 Thread Nadav Amit
Currently, on_each_cpu() and similar functions do not exploit the potential of concurrency: the function is first executed remotely and only then it is executed locally. Functions such as TLB flush can take considerable time, so this provides an opportunity for performance optimization. To do so,