[Openais] [patch-whitetank] fix pthread kill design error resulting in "Library queue full" messages

Steven Dake sdake at redhat.com
Mon Sep 22 16:34:52 PDT 2008


The ipc system is designed such that there is one thread that uses the
poll system call in a loop.  When the outbound IPC kernel buffers are
filled up, the poll thread is interrupted via the pthread_kill library
function (which also sets POLLOUT) so that poll will allow fallthrough
when outbound messages must be sent but the kernel queue is full and
then becomes available.

It is possible with this design that the number of messages being sent
to the ipc connection by openais_response_send occurs at a faster rate
then the poll thread can be processed.  This causes poll to enter a loop
always being interrupted by pthread_exit as new messages are queued for
the ipc connection.  The result is that new outgoing messages are not
sent in this state to the ipc connection, even though that ipc
connection has buffer space available in the kernel queues for outgoing
messages.

This patch fixes the problem by only sending a signal via pthread_exit
once when the queue has filled to interrupt the blocking poll call
instead of every time a new message is queued.

Patch attached.

Regards
-steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whitetank-ipc-pthread-kill-fix.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20080922/776dfd78/attachment.bin 


More information about the Openais mailing list