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

From: Rafael J. Wysocki
Date: Tue May 01 2012 - 09:47:04 EST


On Tuesday, May 01, 2012, NeilBrown wrote:
> On Mon, 30 Apr 2012 22:33:48 -0700 Arve HjÃnnevÃg <arve@xxxxxxxxxxx> 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@xxxxxxxxxxx>
> > Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
>
> Thanks.
> Reviewed-by: NeilBrown <neilb@xxxxxxx>

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
--
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/