[dahdi-commits] tzafrir: linux/trunk r10052 - /linux/trunk/drivers/dahdi/xpp/xframe_queue.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Wed Jul 20 11:48:49 CDT 2011
Author: tzafrir
Date: Wed Jul 20 11:48:46 2011
New Revision: 10052
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10052
Log:
xpp: rate limit queue overflow messages
If the CPU becomes overly busy, merely printing the "Overflow in the
recieve_queue" messages becomes CPU-intensive on its own right.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Modified:
linux/trunk/drivers/dahdi/xpp/xframe_queue.c
Modified: linux/trunk/drivers/dahdi/xpp/xframe_queue.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xframe_queue.c?view=diff&rev=10052&r1=10051&r2=10052
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xframe_queue.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xframe_queue.c Wed Jul 20 11:48:46 2011
@@ -48,6 +48,7 @@
static bool __xframe_enqueue(struct xframe_queue *q, xframe_t *xframe)
{
int ret = 1;
+ static int overflow_cnt = 0;
if(unlikely(q->disabled)) {
ret = 0;
@@ -55,7 +56,8 @@
}
if(q->count >= q->max_count) {
q->overflows++;
- NOTICE("Overflow of %-15s: counts %3d, %3d, %3d worst %3d, overflows %3d worst_lag %02ld.%ld ms\n",
+ if ((overflow_cnt++ % 1000) < 5) {
+ NOTICE("Overflow of %-15s: counts %3d, %3d, %3d worst %3d, overflows %3d worst_lag %02ld.%ld ms\n",
q->name,
q->steady_state_count,
q->count,
@@ -64,7 +66,8 @@
q->overflows,
q->worst_lag_usec / 1000,
q->worst_lag_usec % 1000);
- __xframe_dump_queue(q);
+ __xframe_dump_queue(q);
+ }
ret = 0;
goto out;
}
More information about the dahdi-commits
mailing list