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

Dmitry Agaphonov rzhe at agava.com
Thu Dec 1 12:06:16 GMT 2005


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.


More information about the freebsd-hackers mailing list