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] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1110251105221.3089-100000@iolanthe.rowland.org>
Date:	Tue, 25 Oct 2011 11:14:53 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	mark gross <markgross@...gnar.org>
cc:	NeilBrown <neilb@...e.de>, <linux-kernel@...r.kernel.org>,
	John Stultz <john.stultz@...aro.org>,
	"Rafael J. Wysocki" <rjw@...k.pl>, <arve@...roid.com>,
	<amit.kucheria@...aro.org>, <farrowg@...ibm.com>,
	"Dmitry Fink (Palm GBU)" <Dmitry.Fink@...m.com>,
	<linux-pm@...ts.linux-foundation.org>, <khilman@...com>,
	Magnus Damm <damm@...nsource.se>, <mjg@...hat.com>,
	<peterz@...radead.org>
Subject: Re: [markgross@...ngar.org: [RFC] wake up notifications and suspend
 blocking (aka more wakelock stuff)]

On Mon, 24 Oct 2011, mark gross wrote:

> > > Timeout?  why can't we define a proper notification handshake for such
> > > things?  Timeouts are never right IMO.
> > > 
> > 
> > I thought that before, but I have come around to the opposite way of thinking
> > thanks to some instructive examples from Alan and Rafael.
> > 
> > Some things are simply not visible to the OS.  We can expect them to be
> > happening but we cannot be sure and there is no clear signal that they aren't
> > actually happening.  So we need a timeout.
> 
> um

> > - USB cannot (I think) know which USB device triggered a wake-from-suspend,
> >   and in any case cannot directly ask the device why it woke from suspend.
> >   It has to wait for the device to tell it (in response to a regular
> >   'interrupt' poll I assume - but it isn't guaranteed to be reported on the
> >   first poll) - or timeout and give up waiting.
> maybe if you are unwilling to change the user mode stack that is reading
> these events.  But if you where they you shouldn't need time outs.

Remember, here we are talking about timeouts in the kernel stack, not
in the user-mode stack.

So consider this theoretical situation (which is not very different
from reality): The system gets a wakeup signal.  Sometime in the next
30 ms or less, there may or may not be an input event -- the kernel has
no way to tell other than wait and see.

The kernel could simply go right back to sleep without waiting, but if
it does and there is a pending input event, then very quickly it will
get another wakeup signal, and it'll be right back where it started -- 
trying to decide whether to stay awake for the next 30 ms.

Can you suggest a way to handle this other than using a timeout?

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