This PR comes as a result to enabling MALLOC_STATS on 4.1 branch and noticing kamailio slowdown. On 4.1 the slowdown was happening because each time a memory function was called, iteration through all fragments happened upon `pkg_info`.
On master this is not happening anymore, because `qm->ffrags` variable counts the fragments "on the fly", while memory functions are called. Still, is it necessarily to call pkg_proc_update_stats() callback every time?!
Feel free to close this if not needed. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/567
-- Commit Summary --
* kex: Call pkg_proc_update_stats only when needed
-- File Changes --
M events.c (13) M events.h (1) M mem/f_malloc.c (9) M mem/q_malloc.c (18) M modules/kex/pkg_stats.c (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/567.patch https://github.com/kamailio/kamailio/pull/567.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/567
I doesn't look ok, because the stats will be built only for rpc process, not for all kamailio processes.
Iirc, the pkg stats were refactored because they were initially slow, but probably not available in 4.1. Anyhow, this solution doesn't seem ok, either a full backport or some other solution if you want to push something to 4.1.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/567#issuecomment-210115549
Thanks for making it clear for me. Closing this for now.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/567#issuecomment-210301265
Closed #567.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/567#event-628434993