linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Strange EPOLLOUT|EPOLLET behaviour (spurious events)
@ 2012-04-22 15:32 Christof Meerwald
  0 siblings, 0 replies; only message in thread
From: Christof Meerwald @ 2012-04-22 15:32 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,

I am seeing some unexpected behaviour with EPOLLOUT in edge-triggered
mode - some example code is available from
http://svn.cmeerw.net/src/nginetd/trunk/test/eptest-out.c

What seems to be happening is that I get an EPOLLOUT event after each
send on the socket (even in edge-triggered mode). This is what strace
shows me:

epoll_create(1024)                      = 3
socketpair(PF_FILE, SOCK_DGRAM, 0, [4, 5]) = 0
fcntl(5, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(5, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
epoll_ctl(3, EPOLL_CTL_ADD, 5, {EPOLLIN|EPOLLOUT|EPOLLET, {u32=5, u64=5}}) = 0
sendto(5, "\0\0\0\0", 4, 0, NULL, 0)    = 4
recvfrom(4, "\0\0\0\0", 4, 0, NULL, NULL) = 4
epoll_wait(3, {{EPOLLOUT, {u32=5, u64=5}}}, 16, 0) = 1
sendto(5, "\1\0\0\0", 4, 0, NULL, 0)    = 4
recvfrom(4, "\1\0\0\0", 4, 0, NULL, NULL) = 4
epoll_wait(3, {{EPOLLOUT, {u32=5, u64=5}}}, 16, 0) = 1
sendto(5, "\2\0\0\0", 4, 0, NULL, 0)    = 4
recvfrom(4, "\2\0\0\0", 4, 0, NULL, NULL) = 4
epoll_wait(3, {{EPOLLOUT, {u32=5, u64=5}}}, 16, 0) = 1

But as I am using EPOLLET, I wouldn't expect to get any EPOLLOUT
events on that socket as send never returns EAGAIN (and there isn't
any state transition).

BTW, I have seen https://lkml.org/lkml/2011/11/17/48 , but my case is
different (as there isn't any EPOLLIN event on that socket either).

Am I missing something here?


Christof

-- 

http://cmeerw.org                              sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org                   xmpp:cmeerw at cmeerw.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-22 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-22 15:32 Strange EPOLLOUT|EPOLLET behaviour (spurious events) Christof Meerwald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).