lkml.org 
[lkml]   [2020]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][v2] PM / s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle
On Mon, Jun 22, 2020 at 06:19:35PM +0200, Rafael J. Wysocki wrote:
> > Fixes: b2a02fc43a1f ("smp: Optimize send_call_function_single_ipi()")
> > Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > Cc: Len Brown <lenb@kernel.org>
> > Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Signed-off-by: Chen Yu <yu.c.chen@intel.com>
>
> Peter, any more comments here?

Only that the whole s2idle stuff could do with a cleanup :-)

> > +static int call_s2idle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
> > + int index)
> > +{
> > + if (!current_clr_polling_and_test())
> > + s2idle_enter(drv, dev, index);
> > +
> > + return index;
>
> Is the value returned here used at all?
>
> > +}
> > +
> > /**
> > * cpuidle_enter_s2idle - Enter an idle state suitable for suspend-to-idle.
> > * @drv: cpuidle driver for the given CPU.
> > @@ -187,7 +197,7 @@ int cpuidle_enter_s2idle(struct cpuidle_driver *drv, struct cpuidle_device *dev)
> > */
> > index = find_deepest_state(drv, dev, U64_MAX, 0, true);
> > if (index > 0)
> > - enter_s2idle_proper(drv, dev, index);
> > + call_s2idle(drv, dev, index);
>
> I'm wondering why this can't be
>
> if (index > 0 && !current_clr_polling_and_test())
> enter_s2idle_proper(drv, dev, index);

Works for me. Some Wysocki guy wrote much of it, best ask him :-)

The thing that confused me is that all this is way different from the
normal idle path and didn't keep the invariants.

Ideally; much of that gets folded back into the normal patch somehow.

\
 
 \ /
  Last update: 2020-06-22 19:48    [W:0.101 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site