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

From: Rafael J. Wysocki
Date: Mon Aug 13 2018 - 04:01:35 EST


On Sun, Aug 12, 2018 at 6:07 PM <leo.yan@xxxxxxxxxx> wrote:
>
> On Sun, Aug 12, 2018 at 01:12:41PM +0200, Rafael J. Wysocki wrote:
> > On Fri, Aug 10, 2018 at 11:03 AM <leo.yan@xxxxxxxxxx> wrote:

[cut]

> >
> > Assuming shot noise wakeups, if
> > drv->states[drv->state_count-1].target_residency is less than
> > TICK_USEC, the tick will be stopped for CPUs more often on average
> > with the patch applied (simply because the idle duration range for
> > which it will not be stopped is narrower then).
>
> Yes, good point, so in the new approach I try to change the code
> to compare with next tick delta rather than TICK_USEC, it can keeps
> running tick for the tick with long expire time (similiar with
> comparing with TICK_USEC) but we also can stop tick if the tick is likely
> to break idle residency.

We tried something similar and the results were not encouraging.
Please see https://lore.kernel.org/lkml/079e16b6-2e04-2518-0553-66becab226a6@xxxxxxxxxxxxx/