[asterisk-dev] (Possibly) Unnecessary futex calls

Benny Amorsen benny+usenet at amorsen.dk
Fri Feb 20 05:04:59 CST 2009


I have done a strace on Asterisk when handling just one call with SIP/RTP.

Before the call and during call setup, Asterisk doesn't seem to make
very many system calls, which is good. However, once the call is running:

[pid 25451] <... poll resumed> )
[pid 25451] recvfrom
[pid 25451] sendto
[pid 25451] poll
[pid 25452] <... poll resumed> )
[pid 25452] recvfrom
[pid 25452] sendto
[pid 25452] poll
[pid 25452] recvfrom
[pid 25452] sendto
[pid 25452] poll
[pid 25451] <... poll resumed> )
[pid 25451] recvfrom
[pid 25451] sendto
[pid 25451] poll
[pid  8947] <... futex resumed> )       = -1 ETIMEDOUT (Connection timed out)
[pid  8947] futex(0x7f20b27cf8c8, FUTEX_WAKE_PRIVATE, 1) = 0
[pid  8947] futex(0x7f20b27cf8f4, FUTEX_WAIT_PRIVATE, 235406023, {0, 4876457}) = -1 ETIMEDOUT (Connection timed out)
[pid  8947] futex(0x7f20b27cf8c8, FUTEX_WAKE_PRIVATE, 1) = 0
[pid  8947] futex(0x7f20b27cf8f4, FUTEX_WAIT_PRIVATE, 235406025, {0, 4894917}) = -1 ETIMEDOUT (Connection timed out)
[pid  8947] futex(0x7f20b27cf8c8, FUTEX_WAKE_PRIVATE, 1) = 0
[pid  8947] futex(0x7f20b27cf8f4, FUTEX_WAIT_PRIVATE, 235406027, {0, 4896877}) = -1 ETIMEDOUT (Connection timed out)
[pid  8947] futex(0x7f20b27cf8c8, FUTEX_WAKE_PRIVATE, 1) = 0
[pid  8947] futex(0x7f20b27cf8f4, FUTEX_WAIT_PRIVATE, 235406029, {0, 4895393} <unfinished ...>
[pid 25451] <... poll resumed> )        = 1 ([{fd=19, revents=POLLIN}])

I can understand why all the recvfrom, sendto, and poll calls are
there. However, what is pid 8947 doing?! It seems to be waking up
because of a futex at least 25 times a second.

Why does it do that? The version is 1.6.1 beta 4 by the way, I really
ought to upgrade to rc1.


/Benny





More information about the asterisk-dev mailing list