Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-09 Thread Thomas Gleixner
On Fri, 8 Feb 2008, Venki Pallipadi wrote: > On Fri, Feb 08, 2008 at 11:28:48AM +0100, Andi Kleen wrote: > > > > > - set_cpus_allowed(current, tmp); > > > + smp_mb(); > > > + /* kick all the CPUs so that they exit out of pm_idle */ > > > + smp_call_function(do_nothing, NULL, 0, 0); > > > > I

Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-09 Thread Thomas Gleixner
On Fri, 8 Feb 2008, Venki Pallipadi wrote: On Fri, Feb 08, 2008 at 11:28:48AM +0100, Andi Kleen wrote: - set_cpus_allowed(current, tmp); + smp_mb(); + /* kick all the CPUs so that they exit out of pm_idle */ + smp_call_function(do_nothing, NULL, 0, 0); I think the last

Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-08 Thread Andi Kleen
On Fri, Feb 08, 2008 at 09:24:30AM -0800, Venki Pallipadi wrote: > On Fri, Feb 08, 2008 at 11:28:48AM +0100, Andi Kleen wrote: > > > > > - set_cpus_allowed(current, tmp); > > > + smp_mb(); > > > + /* kick all the CPUs so that they exit out of pm_idle */ > > > + smp_call_function(do_nothing, NULL,

Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-08 Thread Venki Pallipadi
On Fri, Feb 08, 2008 at 11:28:48AM +0100, Andi Kleen wrote: > > > - set_cpus_allowed(current, tmp); > > + smp_mb(); > > + /* kick all the CPUs so that they exit out of pm_idle */ > > + smp_call_function(do_nothing, NULL, 0, 0); > > I think the last argument (wait) needs to be 1 to make

Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-08 Thread Andi Kleen
> - set_cpus_allowed(current, tmp); > + smp_mb(); > + /* kick all the CPUs so that they exit out of pm_idle */ > + smp_call_function(do_nothing, NULL, 0, 0); I think the last argument (wait) needs to be 1 to make sure it is synchronous (for 32/64) Otherwise the patch looks

Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-08 Thread Andi Kleen
- set_cpus_allowed(current, tmp); + smp_mb(); + /* kick all the CPUs so that they exit out of pm_idle */ + smp_call_function(do_nothing, NULL, 0, 0); I think the last argument (wait) needs to be 1 to make sure it is synchronous (for 32/64) Otherwise the patch looks great.

Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-08 Thread Andi Kleen
On Fri, Feb 08, 2008 at 09:24:30AM -0800, Venki Pallipadi wrote: On Fri, Feb 08, 2008 at 11:28:48AM +0100, Andi Kleen wrote: - set_cpus_allowed(current, tmp); + smp_mb(); + /* kick all the CPUs so that they exit out of pm_idle */ + smp_call_function(do_nothing, NULL, 0, 0); I

Re: [PATCH] x86: Simplify cpu_idle_wait

2008-02-08 Thread Venki Pallipadi
On Fri, Feb 08, 2008 at 11:28:48AM +0100, Andi Kleen wrote: - set_cpus_allowed(current, tmp); + smp_mb(); + /* kick all the CPUs so that they exit out of pm_idle */ + smp_call_function(do_nothing, NULL, 0, 0); I think the last argument (wait) needs to be 1 to make sure it is

[PATCH] x86: Simplify cpu_idle_wait

2008-02-07 Thread Venki Pallipadi
Earlier commit 40d6a146629b98d8e322b6f9332b182c7cbff3df added smp_call_function in cpu_idle_wait() to kick cpus that are in tickless idle. Looking at cpu_idle_wait code at that time, code seemed to be over-engineered for a case which is rarely used (while changing idle handler). Below is a

[PATCH] x86: Simplify cpu_idle_wait

2008-02-07 Thread Venki Pallipadi
Earlier commit 40d6a146629b98d8e322b6f9332b182c7cbff3df added smp_call_function in cpu_idle_wait() to kick cpus that are in tickless idle. Looking at cpu_idle_wait code at that time, code seemed to be over-engineered for a case which is rarely used (while changing idle handler). Below is a