From 6041facaf62d2ba609bd0238470aaead2ed1fb9e Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Thu, 23 Sep 2010 21:38:52 +0000 Subject: wcte12xp, wctdm24xxp: Convert vbb cache from kmem_cache to dma_pool. The voicebus interface constantly uses the same buffers for moving data to/from the card. A fixed pool has less overhead in this case than constantly mapping/unmapping the kmem_cache_alloced buffers. Saves about ~2.608 us for each run of vb_isr on a 2.40 GHz Xeon test machine. Signed-off-by: Shaun Ruffell Acked-by: Russ Meyerriecks git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9402 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wctdm24xxp/base.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/dahdi/wctdm24xxp') diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 15cc48e..cb390d0 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -2223,7 +2223,7 @@ static void handle_hx8_transmit(struct voicebus *vb, struct list_head *buffers) list_for_each_entry_safe(vbb, n, buffers, entry) { list_del(&vbb->entry); - kmem_cache_free(voicebus_vbb_cache, vbb); + dma_pool_free(vb->pool, vbb, vbb->dma_addr); } } @@ -4408,6 +4408,7 @@ static int hx8_send_command(struct wctdm *wc, const u8 *command, struct sframe_packet *frame; const int MAX_COMMAND_LENGTH = 264 + 4; unsigned long flags; + dma_addr_t dma_addr; might_sleep(); @@ -4420,11 +4421,12 @@ static int hx8_send_command(struct wctdm *wc, const u8 *command, if (count > MAX_COMMAND_LENGTH) return -EINVAL; - vbb = kmem_cache_alloc(voicebus_vbb_cache, GFP_KERNEL); + vbb = dma_pool_alloc(wc->vb.pool, GFP_KERNEL, &dma_addr); WARN_ON(!vbb); if (!vbb) return -ENOMEM; - + + vbb->dma_addr = dma_addr; memset(vbb->data, 0, SFRAME_SIZE); memcpy(&vbb->data[EFRAME_SIZE + EFRAME_GAP], command, count); -- cgit v1.2.3