Re: [PATCH] epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready

Rafael J. Wysocki
2012-05-01T13:47:04Z

On Tuesday, May 01, 2012, NeilBrown wrote:
> On Mon, 30 Apr 2012 22:33:48 -0700 Arve Hjønnevåg <arve@android.com> wrote:
>
> > When an epoll_event, that has the EPOLLWAKEUP flag set, is ready, a
> > wakeup_source will be active to prevent suspend. This can be used to
> > handle wakeup events from a driver that support poll, e.g. input, if
> > that driver wakes up the waitqueue passed to epoll before allowing
> > suspend.
> >
> > Signed-off-by: Arve Hjønnevåg <arve@android.com>
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>
> Thanks.
> Reviewed-by: NeilBrown <neilb@suse.de>

Thanks a lot for your involvement here!

> However:
> 1/ I think all references to "automatic system suspend" can be replaced with
> "system suspend" as an active wakeup_source disables any suspend, no matter
> it's source

OK, I'll change that when applying the patch (although that only applies to
suspends taking the wakeup events signaling through wakeup sources into
account).

> 2/ I reserve to right to submit for discussion a later patch which removes
> the ep->ws in favour or some other exclusion mechanism :-)

Well, you can alwyas do that. :-) Of course, when the patch goes to Linus,
we'll have to be careful about changes visible to user space, though.

Thanks,
Rafael