Problem with unix dgram socket based messaging?
Volker Lendecke
Volker.Lendecke at SerNet.DE
Sat May 26 07:23:09 GMT 2007
Hi, Tridge!
Testing the unix dgram based messaging a bit more I think I
found a problem with it.
In case a process we want to send something to is stuck
somewhere eventually its skb buffers will fill up and we
will get a -EAGAIN. In this case, we will queue the message
and set EVENT_FD_WRITEABLE(msg->event.fde);. The problem is:
The dgram socket will *always* be writable, it is the
recipient's buffer that is full, not ours. The relevant
portion of linux/net/unix/af_unix.c:1355 (2.6.16.13-4, SuSE)
says:
if (unix_peer(other) != sk &&
(skb_queue_len(&other->sk_receive_queue) >
other->sk_max_ack_backlog)) {
if (!timeo) {
err = -EAGAIN;
goto out_unlock;
}
See that the kernel is looking at "other", not "sk" for the
receive queue length.
This generates a CPU eater per process trying to send a
message. With the tdb-based model we don't have to retry, we
just store our message and kill(USR1). No CPU eating.
I know that no process should be blocked for extended
periods of time, but I fear that this behaviour would make
an overload situation just worse.
What do you think?
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20070526/515c431e/attachment.bin
More information about the samba-technical
mailing list