diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-09-24 22:44:30 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-09-24 22:44:30 +0000 |
commit | bafcae078f30c3113bcfd82039dbb811e66f9544 (patch) | |
tree | fcaaeb971c76dd23ba97f287dda1ffd0fb2f7365 /include/dahdi/kernel.h | |
parent | 70dfe0a65c74d790ac0c8b4ec0e8b72e9c7638b4 (diff) |
dahdi: Only disable/enable interrupts once when iterating through channels.
dahdi_receive, dahdi_transmit, and dahdi_ec_span are mostly called from
interrupt context anyway, so we can save a few cycles by not saving and
restoring the interrupt flags for every channel.
On one 2.40GHz Xeon test machine, for a span with 24 channels w/o echocan
enabled with ~10000 samples:
Function Avg Before Avg After
======================================
dahdi_receive 2.109 us 1.547 us
dahdi_transmit 3.203 us 2.766 us
dahdi_ec_span 0.416 us 0.454 us
NOTE: The time went up slightly on dahdi_ec_span since I did not have
software echocan enabled and this change calls local_irq_save regardless
in dahdi_ec_span. The slight increase in processing time in this case
is overshadowed by the savings in dahdi_receive and dahdi_transmit. If
echocan was enabled on all the channels there would be a time savings
in that dahdi_ec_span too.
When dahdi_receive/dahdi_transmit are called every millisecond (when
DAHDI_CHUNKSIZE == 8) this saves ~0.1% CPU time for each span.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Review: https://reviewboard.asterisk.org/r/940/
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9406 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include/dahdi/kernel.h')
0 files changed, 0 insertions, 0 deletions