Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Nov 2015 10:53:07 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        Rasool Al-Saadi <ralsaadi@swin.edu.au>, "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Timing issue with Dummynet on high kernel timer interrupt
Message-ID:  <563B2703.5080402@selasky.org>
In-Reply-To: <6545444AE21C2749939E637E56594CEA3C0DE7FF@gsp-ex02.ds.swin.edu.au>
References:  <6545444AE21C2749939E637E56594CEA3C0DCCC4@gsp-ex02.ds.swin.edu.au> <5638B7B5.3030802@selasky.org> <6545444AE21C2749939E637E56594CEA3C0DE7FF@gsp-ex02.ds.swin.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------010409060107000901010706
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit

On 11/05/15 00:44, Rasool Al-Saadi wrote:
>
> On Wednesday, 4 November 2015 12:34 AM, Hans Petter Selasky wrote:
>> On 11/03/15 14:14, Rasool Al-Saadi wrote:
>>> Does anyone have thoughts on what we can test next to narrow down the
>> root-cause of these unusual timing jumps?
>>
>> You might also want to test the "projects/hps_head" branch, which uses a bit
>> different callout implementation.
>
> Thanks Hans for your suggestion.
> I have tried "projects/hps_head" branch and the result is better (number of spikes is less than in the master branch). However, the problem still exists on the same timer interrupt frequencies (>3000 in my case). You can see in this graph https://goo.gl/photos/C2Mqx4xhMQuzxWnz6 the RTT spikes still there.
>
> Do you have any further suggestions?
>

Hi,

If the jitter is in the xx milliseconds range, like your graph shows, my 
guess is that td_owepreemt is not set when we return from the dummynet() 
callback. See attached patch.

Else you might want to try to remove the C_HARDCLOCK flag from 
callout_reset_sbt() in ip_dummynet.c.

--HPS


--------------010409060107000901010706
Content-Type: text/x-patch;
 name="ip_dummynet.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="ip_dummynet.c.diff"

Index: sys/netpfil/ipfw/ip_dummynet.c
===================================================================
--- sys/netpfil/ipfw/ip_dummynet.c	(revision 290134)
+++ sys/netpfil/ipfw/ip_dummynet.c	(working copy)
@@ -78,6 +78,8 @@
 static struct task	dn_task;
 static struct taskqueue	*dn_tq = NULL;
 
+#include <sys/sched.h>
+
 static void
 dummynet(void *arg)
 {
@@ -84,6 +86,9 @@
 
 	(void)arg;	/* UNUSED */
 	taskqueue_enqueue_fast(dn_tq, &dn_task);
+
+	/* ensure taskqueue gets running */
+	sched_preempt(curthread);
 }
 
 void

--------------010409060107000901010706--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?563B2703.5080402>