Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #471

Strange EPOLLOUT|EPOLLET behaviour (spurious events)

Newsgroups comp.os.linux.development.apps
From Christof Meerwald <NOSPAM-seeMySig+uyk5+@usenet.cmeerw.org>
Subject Strange EPOLLOUT|EPOLLET behaviour (spurious events)
Organization Hacking@Home
Message-ID <slrnjpgo5a.q7.cmeerw@msgid.cmeerw.org> (permalink)
Date 2012-04-25 20:38 +0000

Show all headers | View raw


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

Back to comp.os.linux.development.apps | Previous | NextNext in thread | Find similar


Thread

Strange EPOLLOUT|EPOLLET behaviour (spurious events) Christof Meerwald <NOSPAM-seeMySig+uyk5+@usenet.cmeerw.org> - 2012-04-25 20:38 +0000
  Re: Strange EPOLLOUT|EPOLLET behaviour (spurious events) Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-04-25 23:11 +0100
    Re: Strange EPOLLOUT|EPOLLET behaviour (spurious events) Christof Meerwald <NOSPAM-seeMySig+upk5+@usenet.cmeerw.org> - 2012-04-26 06:01 +0000
      Re: Strange EPOLLOUT|EPOLLET behaviour (spurious events) Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-04-26 15:14 +0100
      Re: Strange EPOLLOUT|EPOLLET behaviour (spurious events) Christof Meerwald <NOSPAM-seeMySig+u0k5+@usenet.cmeerw.org> - 2012-04-26 21:11 +0000

csiph-web