Re: [RFD] Automatic suspend

From: Pavel Machek
Date: Fri Feb 27 2009 - 15:41:22 EST


On Fri 2009-02-27 15:22:39, Rafael J. Wysocki wrote:
> On Friday 27 February 2009, Pavel Machek wrote:
> > Hi!
> >
> > > > > Then, the decision making logic will be able to use /sys/power/sleep whenever
> > > > > it wishes to and the kernel will be able to refuse to suspend if it's not
> > > > > desirable at the moment.
> > > > >
> > > > > It seems to be flexible enough to me.
> > > >
> > > > This seems flexible enough to avoid race conditions, but it forces the
> > > > user space power manager to poll when the kernel refuse suspend.
> > >
> > > And if the kernel is supposed to start automatic suspend, it has to monitor
> > > all of the wakelocks. IMO, it's better to allow the power manager to poll the
> > > kernel if it refuses to suspend.
> >
> > polling is evil -- it keeps CPU wake up => wastes power.
> >
> > Wakelocks done right are single atomic_t... and if you set it to 0,
> > you just unblock "sleeper" thread or something. Zero polling and very
> > simple...
>
> Except that you have to check all of the wakelocks periodically in a loop =>
> polling. So?

No. I want to have single atomic_t for all the wakelocks... at least
in non-debug version. Debug version will be slower. I believe you
originally suggested that.
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/