[asterisk-dev] [Code Review] Change locks to use a pointer for tracking, to reduce mutex size from 3k on production systems

Russell Bryant reviewboard at asterisk.org
Sun Jan 30 16:13:15 CST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1066/#review3154
-----------------------------------------------------------

Ship it!


Looks good, didn't see any obvious problems

- Russell


On 2011-01-24 04:42:38, Tilghman Lesher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1066/
> -----------------------------------------------------------
> 
> (Updated 2011-01-24 04:42:38)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Eight months ago, a fix went in to solve the problem of loading modules that were compiled with a different value of DEBUG_THREADS than the core Asterisk binary, which results in differences in the structure of a mutex.  Unfortunately, this did not take into account the size of the mutex structure, especially as it pertains to chan_iax2.  The result is that chan_iax2, starting with 1.8, now takes up 100MB of memory.  This is primarily due to the 3016 bytes used for each mutex, which is in each astobj2, and we allocate 32767 of them at boot, one for each possible IAX2 source number.  This patch changes the lock tracking from a builtin struct to a pointer, allocated only when tracking is active (typically when debugging).
> 
> 
> This addresses bug 18194.
>     https://issues.asterisk.org/view.php?id=18194
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/include/asterisk/lock.h 303461 
>   /branches/1.8/main/heap.c 303461 
>   /branches/1.8/main/lock.c 303461 
>   /branches/1.8/main/utils.c 303461 
> 
> Diff: https://reviewboard.asterisk.org/r/1066/diff
> 
> 
> Testing
> -------
> 
> Compiled both with and without DEBUG_THREADS, verified that the mutex is now much smaller, and Asterisk still functions correctly.
> 
> 
> Thanks,
> 
> Tilghman
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110130/6c2c4ca0/attachment.htm>


More information about the asterisk-dev mailing list