lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 19 Feb 2009 17:08:20 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
cc:	Arve Hjønnevåg <arve@...roid.com>,
	"Woodruff, Richard" <r-woodruff2@...com>,
	Arjan van de Ven <arjan@...radead.org>,
	Kyle Moffett <kyle@...fetthome.net>,
	Oliver Neukum <oliver@...kum.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	pm list <linux-pm@...ts.linux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>, Pavel Machek <pavel@....cz>,
	Nigel Cunningham <nigel@...el.suspend2.net>,
	Matthew Garrett <mjg59@...f.ucam.org>,
	mark gross <mgross@...ux.intel.com>,
	Uli Luckas <u.luckas@...d.de>,
	Igor Stoppa <igor.stoppa@...ia.com>,
	Brian Swetland <swetland@...gle.com>,
	Len Brown <lenb@...nel.org>
Subject: Re: [RFD] Automatic suspend

On Thu, 19 Feb 2009, Rafael J. Wysocki wrote:

> > > Again, the decision to trigger automatic suspend has to be based on some
> > > well defined criteria and the (in)activity of devices seems to be one of them.
> > 
> > I don't know what criteria the system monitor would use.
> 
> I don't know either and this is the whole point.  They need to be specified
> somehow and I'm not sure if "we suspend if no one is holding a wakelock" is the
> right approach.

That isn't really a criterion; it's just a mechanism.  All it does is
push the problem back one level.  Now the question becomes: When is it
appropriate/necessary to hold a wakelock?

> > It might have to be platform-specific.  The Android people seem to have a
> > pretty good idea of what criteria will work for them.
> 
> I'd really like to know in what situations Androind is supposed to suspend
> automatically.

It might be better to ask in what situations Android is _not_ supposed
to sleep automatically.  In other words, in what situations is a
wakelock acquired?  Since the whole system is only a phone, this
question should have a reasonably well-defined answer.

> > Inactivity of devices isn't always a good criterion.  There might be a
> > background task which wakes up every few seconds to do something as
> > long as the system is awake, thereby keeping some device always active.  
> > The activity from this background task shouldn't prevent an auto-sleep.
> 
> In fact there are two problems here.  First, there may be a task preventing
> some devices from becoming inactive (like syslog).

Which means that device inactivity isn't always a good indicator for
auto-sleep.  (But then there can be different levels of activity: A
disk should always block auto-sleep while it is carrying out I/O, but
it might not block auto-sleep just because it is spinning.)

>  Second, there may be
> a task waiting for something important to happen, such that automatic suspend
> cannot be triggered while it's waiting.  In both cases, IMO, the kernel is not
> in a point to decide whether to suspend or not, because the user space knows
> better.

That's the whole point behind userspace wakelocks!  They provide a
mechanism for userspace to tell the kernel when (as far as userspace is
concerned) it is or is not okay to auto-sleep.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ