Re: Unifying epoll,aio,futexes etc. (What I really want from epoll)

John Gardiner Myers (jgmyers@netscape.com)
Fri, 01 Nov 2002 15:27:41 -0800


Jamie Lokier wrote:

>You avoid the extra CPU cycles like this:
>
> 1. EP_CTL_ADD adds the listener to the file's wait queue using
> ->poll(), and gets a free test of the object readiness [;)]
>
> 2. When the transition happens, the wakeup will call your function,
> epoll_wakeup_function. That removes the listener from the file's
> wait queue. Note, you won't see any more wakeups from that file.
>
> 3. When you report the event user space, _then_ you automatically
> add the listener back to the file's wait queue by calling ->poll().
>
>
The cost of removing and readding the listener to the file's wait queue
is part of what epoll is amortizing.

There's also the oddity that I noticed this week: pipes don't report
POLLOUT readiness through the classic poll interface until the pipe's
buffer is completely empty. Changing this to report POLLOUT readiness
when the pipe's buffer is not full apparently causes NIS to break.

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