Re: epoll reporting events when it hasn't been asked to

From: Davide Libenzi
Date: Fri Apr 02 2004 - 10:25:09 EST


On Fri, 2 Apr 2004, Ben Mansell wrote:

> > If an exception occurs (example a socket is disconnected) the socket
> > should be removed from the fd list. There is really no point in passing
> > in an excepted fd.
>
> Is there any difference, speed-wise, between turning off all events to
> listen to with EPOLL_MOD, and removing the file descriptor with
> EPOLL_DEL? I had vaguely assumed that the former would be faster
> (especially if you might later want to resume listening for events),
> although that was just a guess.

It is faster. OTOH nothing prevent you to use your current method. You
have only to handle exceptional condition instead of ignoring them.
Handling by, for example, removing the fd from the epoll set and
unregistering/freeing the associated data structures. IMO we can leave the
current behaviour, but if someone sees huge problems with this, the fix is
a one-liner.



- Davide


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