Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-13 Thread leo . yan
On Mon, Aug 13, 2018 at 10:01:20AM +0200, Rafael J. Wysocki wrote: > On Sun, Aug 12, 2018 at 6:07 PM wrote: > > > > On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote: > > > On Fri, Aug 10, 2018 at 11:03 AM wrote: > > [cut] > > > > > > > Assuming shot noise wakeups, if > > >

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-13 Thread leo . yan
On Mon, Aug 13, 2018 at 10:01:20AM +0200, Rafael J. Wysocki wrote: > On Sun, Aug 12, 2018 at 6:07 PM wrote: > > > > On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote: > > > On Fri, Aug 10, 2018 at 11:03 AM wrote: > > [cut] > > > > > > > Assuming shot noise wakeups, if > > >

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-13 Thread Rafael J. Wysocki
On Sun, Aug 12, 2018 at 6:07 PM wrote: > > On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote: > > On Fri, Aug 10, 2018 at 11:03 AM wrote: [cut] > > > > Assuming shot noise wakeups, if > > drv->states[drv->state_count-1].target_residency is less than > > TICK_USEC, the tick will

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-13 Thread Rafael J. Wysocki
On Sun, Aug 12, 2018 at 6:07 PM wrote: > > On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote: > > On Fri, Aug 10, 2018 at 11:03 AM wrote: [cut] > > > > Assuming shot noise wakeups, if > > drv->states[drv->state_count-1].target_residency is less than > > TICK_USEC, the tick will

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-12 Thread leo . yan
On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote: > On Fri, Aug 10, 2018 at 11:03 AM wrote: > > > > On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > > > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > > > On Fri, Aug 10, 2018 at 9:13 AM, wrote:

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-12 Thread leo . yan
On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote: > On Fri, Aug 10, 2018 at 11:03 AM wrote: > > > > On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > > > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > > > On Fri, Aug 10, 2018 at 9:13 AM, wrote:

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-12 Thread Rafael J. Wysocki
On Fri, Aug 10, 2018 at 11:03 AM wrote: > > On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: >

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-12 Thread Rafael J. Wysocki
On Fri, Aug 10, 2018 at 11:03 AM wrote: > > On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: >

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > > >> On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Fri, Aug 10, 2018 at 04:49:06PM +0800, Leo Yan wrote: > On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > > >> On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > >> On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > > [cut] > > >> And that will cause the tick to be stopped

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Fri, Aug 10, 2018 at 09:22:10AM +0200, Rafael J. Wysocki wrote: > On Fri, Aug 10, 2018 at 9:13 AM, wrote: > > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > >> On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > > [cut] > > >> And that will cause the tick to be stopped

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread Rafael J. Wysocki
On Fri, Aug 10, 2018 at 9:13 AM, wrote: > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: >> On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: [cut] >> And that will cause the tick to be stopped unnecessarily in certain >> situations, so why is this better? > > Let's see below

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread Rafael J. Wysocki
On Fri, Aug 10, 2018 at 9:13 AM, wrote: > On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: >> On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: [cut] >> And that will cause the tick to be stopped unnecessarily in certain >> situations, so why is this better? > > Let's see below

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > > The criteria for keeping tick running is the prediction duration is less > > than TICK_USEC, > > Yes, because if the predicted idle duration is less than the tick > period,

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-10 Thread leo . yan
On Thu, Aug 09, 2018 at 10:47:17PM +0200, Rafael J. Wysocki wrote: > On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > > The criteria for keeping tick running is the prediction duration is less > > than TICK_USEC, > > Yes, because if the predicted idle duration is less than the tick > period,

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-09 Thread Rafael J. Wysocki
On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > The criteria for keeping tick running is the prediction duration is less > than TICK_USEC, Yes, because if the predicted idle duration is less than the tick period, stopping the tick is pointless overhead (if the governor predicts a CPU wakeup

Re: [RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-09 Thread Rafael J. Wysocki
On Thu, Aug 9, 2018 at 7:20 PM, Leo Yan wrote: > The criteria for keeping tick running is the prediction duration is less > than TICK_USEC, Yes, because if the predicted idle duration is less than the tick period, stopping the tick is pointless overhead (if the governor predicts a CPU wakeup

[RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-09 Thread Leo Yan
The criteria for keeping tick running is the prediction duration is less than TICK_USEC, the mainline kernel configures HZ=250 so TICK_USEC equals to 4000us, so any prediction is less than 4000us will not stop tick and the idle state will be fixed up to one shallow state. On the other hand, let's

[RESEND PATCH v1 1/2] cpuidle: menu: Correct the criteria for stopping tick

2018-08-09 Thread Leo Yan
The criteria for keeping tick running is the prediction duration is less than TICK_USEC, the mainline kernel configures HZ=250 so TICK_USEC equals to 4000us, so any prediction is less than 4000us will not stop tick and the idle state will be fixed up to one shallow state. On the other hand, let's