Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Andy Lutomirski
Wysocki; >> linux...@vger.kernel.org; LKML; Liu, Changcheng; Wang, Xiaoming; >> Chakravarty, Souvik K >> Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS >> back to DEFAULT >> >> On Thu, Aug 14, 2014 at 2:16 PM, Peter Zijlstra >&g

RE: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Liu, Chuansheng
Chakravarty, Souvik K > Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS > back to DEFAULT > > On Thu, Aug 14, 2014 at 2:16 PM, Peter Zijlstra > wrote: > > On Thu, Aug 14, 2014 at 02:12:27PM -0700, Andy Lutomirski wrote: > >> On 08/14/2014 04:1

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Andy Lutomirski
On Thu, Aug 14, 2014 at 2:16 PM, Peter Zijlstra wrote: > On Thu, Aug 14, 2014 at 02:12:27PM -0700, Andy Lutomirski wrote: >> On 08/14/2014 04:14 AM, Daniel Lezcano wrote: >> > On 08/14/2014 01:00 PM, Peter Zijlstra wrote: >> >> >> >> So seeing how you're from @intel.com I'm assuming you're using x

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Peter Zijlstra
On Thu, Aug 14, 2014 at 02:12:27PM -0700, Andy Lutomirski wrote: > On 08/14/2014 04:14 AM, Daniel Lezcano wrote: > > On 08/14/2014 01:00 PM, Peter Zijlstra wrote: > >> > >> So seeing how you're from @intel.com I'm assuming you're using x86 here. > >> > >> I'm not seeing how this can be possible, MW

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Andy Lutomirski
On 08/14/2014 04:14 AM, Daniel Lezcano wrote: > On 08/14/2014 01:00 PM, Peter Zijlstra wrote: >> >> So seeing how you're from @intel.com I'm assuming you're using x86 here. >> >> I'm not seeing how this can be possible, MWAIT is interrupted by IPIs >> just fine, which means we'll fall out of the cp

RE: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Liu, Chuansheng
ik K > Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS > back to DEFAULT > > On 08/14/2014 04:10 PM, Liu, Chuansheng wrote: > > > > > >> -Original Message- > >> From: Peter Zijlstra [mailto:pet...@infradead.org] > >

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Daniel Lezcano
; Chakravarty, Souvik K Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT On Thu, Aug 14, 2014 at 11:24:06AM +, Liu, Chuansheng wrote: If inspecting the polling flag, we can not fix the race between poll_idle and smp_callback, since in poll_idle(), before

RE: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Liu, Chuansheng
ik K > Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS > back to DEFAULT > > On Thu, Aug 14, 2014 at 11:24:06AM +, Liu, Chuansheng wrote: > > If inspecting the polling flag, we can not fix the race between poll_idle > > and > smp_callback, >

RE: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Liu, Chuansheng
ik K > Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS > back to DEFAULT > I think the main issue here is to exit the poll_idle loop when an IPI is > received. IIUC, there is a pm_qos user, perhaps a driver (Chuansheng can > give more details), setting a v

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Daniel Lezcano
On 08/14/2014 02:41 PM, Peter Zijlstra wrote: On Thu, Aug 14, 2014 at 01:14:49PM +0200, Daniel Lezcano wrote: On 08/14/2014 01:00 PM, Peter Zijlstra wrote: On Thu, Aug 14, 2014 at 12:29:32PM +0200, Daniel Lezcano wrote: Hi Chuansheng, On 14 August 2014 04:11, Chuansheng Liu wrote: We found

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Peter Zijlstra
On Thu, Aug 14, 2014 at 11:24:06AM +, Liu, Chuansheng wrote: > If inspecting the polling flag, we can not fix the race between poll_idle and > smp_callback, > since in poll_idle(), before set polling flag, if the smp_callback come in, > then no resched bit set, > after that, poll_idle() will

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Peter Zijlstra
On Thu, Aug 14, 2014 at 01:14:49PM +0200, Daniel Lezcano wrote: > On 08/14/2014 01:00 PM, Peter Zijlstra wrote: > >On Thu, Aug 14, 2014 at 12:29:32PM +0200, Daniel Lezcano wrote: > >>Hi Chuansheng, > >> > >>On 14 August 2014 04:11, Chuansheng Liu wrote: > >> > >>>We found sometimes even after we l

RE: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Liu, Chuansheng
ik K > Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS > back to DEFAULT > > On Thu, Aug 14, 2014 at 12:29:32PM +0200, Daniel Lezcano wrote: > > Hi Chuansheng, > > > > On 14 August 2014 04:11, Chuansheng Liu > wrote: > > > >

RE: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Liu, Chuansheng
ik K > Subject: Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS > back to DEFAULT > > On 08/14/2014 01:00 PM, Peter Zijlstra wrote: > > On Thu, Aug 14, 2014 at 12:29:32PM +0200, Daniel Lezcano wrote: > >> Hi Chuansheng, > >> > >> On 14

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Daniel Lezcano
On 08/14/2014 01:00 PM, Peter Zijlstra wrote: On Thu, Aug 14, 2014 at 12:29:32PM +0200, Daniel Lezcano wrote: Hi Chuansheng, On 14 August 2014 04:11, Chuansheng Liu wrote: We found sometimes even after we let PM_QOS back to DEFAULT, the CPU still stuck at C0 for 2-3s, don't do the new suitab

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Peter Zijlstra
On Thu, Aug 14, 2014 at 12:29:32PM +0200, Daniel Lezcano wrote: > Hi Chuansheng, > > On 14 August 2014 04:11, Chuansheng Liu wrote: > > > We found sometimes even after we let PM_QOS back to DEFAULT, > > the CPU still stuck at C0 for 2-3s, don't do the new suitable C-state > > selection immediate

Re: [PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-14 Thread Peter Zijlstra
On Thu, Aug 14, 2014 at 12:29:32PM +0200, Daniel Lezcano wrote: > Hi Chuansheng, > > On 14 August 2014 04:11, Chuansheng Liu wrote: > > > We found sometimes even after we let PM_QOS back to DEFAULT, > > the CPU still stuck at C0 for 2-3s, don't do the new suitable C-state > > selection immediate

[PATCH] cpuidle: Fix the CPU stuck at C0 for 2-3s after PM_QOS back to DEFAULT

2014-08-13 Thread Chuansheng Liu
We found sometimes even after we let PM_QOS back to DEFAULT, the CPU still stuck at C0 for 2-3s, don't do the new suitable C-state selection immediately after received the IPI interrupt. The code model is simply like below: { pm_qos_update_request(&pm_qos, C1 - 1); < == Her