Kevent(2) doesn't notify about EVFILT_WRITE filter event

[ Available lists | Index of freebsd-hackers | Month of Dec 2005 | Week of 1 Dec 2005 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Dmitry Agaphonov <rzhe@agava.com>
Date
1 Dec 2005 12:06:16
Subject
Kevent(2) doesn't notify about EVFILT_WRITE filter event
Message-ID
20051201150608.5e8d49f1@rzhe.agava-dubna.local


[ Hide this part ]
Hello all,


I have two applications (server A and server B, A asks B for data to
serve clients) communicating via UNIX-domain socket. Testing local
clients interact to server A via UNIX-domain sockets too. Server A
uses kqueue(2) to handle clients and server B.

When about 20 clients start requesting server A without delay, kevent(2)
doesn't notify about requested EVFILT_WRITE after only few small
requests.


Dumping kevent(2) changelist and eventlist gives the following:

Server A asks for write event (with EV_ONESHOT flag set) to server B:
[13:45:36][DBG] Changing SysEvent: ident: 8, filter: -2, flags: 0x11, fflags: 0, data: 0, udata: 0x0
[13:45:36][DBG] Received SysEvent: ident: 8, filter: -2, flags: 0x11, fflags: 0, data: 8192, udata: 0x0

So, the socket send buffer has 8192 bytes free. Then A sends 426
bytes to B.

Then server A asks for write event again:
[13:45:36][DBG] Changing SysEvent: ident: 8, filter: -2, flags: 0x11, fflags: 0, data: 0, udata: 0x0

After this, EVFILT_WRITE event is not returned. Noone else writes to
this socket. How it is possible?

When I only turn on some additional logging which makes nothing but
logs something and thus makes some small delays between kevent(2)
calls -- all works fine, kevent(2) notifies about all write events.


Could anyone please give thoughts about why kevent(2) can behave so?
I have definitely no idea where the problem can be.

This happens on FreeBSD 4.11-STABLE (cvsup'ed Nov 20 2005), SMP kernel,
P4 with HT.


Elapsed time: 0.124 seconds