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)

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
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
X-PGP-Key 1024D/2B10BE68, 1998-06-29
X-PGP-Fingerprint 0289 5466 C1F5 B03C DBA7 6304 8CAF 9782 2B10 BE68
User-Agent slrn/pre1.0.0-16 (Linux)
Message-ID <slrnjpgo5a.q7.cmeerw@msgid.cmeerw.org> (permalink)
Cancel-Lock sha1:F9TnIwhRgFM+OGtZZ6MPj52vOVw=
X-NNTP-Posting-Host localhost
Date 25 Apr 2012 20:38:03 GMT
Lines 40
NNTP-Posting-Host 84.200.12.152
X-Trace news.sunsite.dk DXC=M[1A[gdSGPfMMDg2]64EMfYSB=nbEKnkk2:l98J8MlRe8`CEJGOoTkoaTD[Ib<knOgJo;nN@KfW3a1cj4o:@GjSc
X-Complaints-To staff@sunsite.dk
Xref csiph.com comp.os.linux.development.apps:471

Show key headers only | 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