From owner-freebsd-current@freebsd.org Fri Nov 6 16:43:53 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55688A28BEB for ; Fri, 6 Nov 2015 16:43:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32D9D1E1C for ; Fri, 6 Nov 2015 16:43:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Fri, 6 Nov 2015 16:42:48 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tA6GhnqZ051087; Fri, 6 Nov 2015 09:43:49 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1446828229.91534.417.camel@freebsd.org> Subject: Re: Timing issue with Dummynet on high kernel timer interrupt From: Ian Lepore To: Hans Petter Selasky , Luigi Rizzo Cc: Rasool Al-Saadi , "freebsd-net@freebsd.org" , FreeBSD Current , Alexander Motin Date: Fri, 06 Nov 2015 09:43:49 -0700 In-Reply-To: <563CD533.2000909@selasky.org> References: <6545444AE21C2749939E637E56594CEA3C0DCCC4@gsp-ex02.ds.swin.edu.au> <5638B7B5.3030802@selasky.org> <6545444AE21C2749939E637E56594CEA3C0DE7FF@gsp-ex02.ds.swin.edu.au> <563B2703.5080402@selasky.org> <6545444AE21C2749939E637E56594CEA3C0E0BD9@gsp-ex02.ds.swin.edu.au> <563C6864.2090907@selasky.org> <563C786C.1050305@selasky.org> <563CC186.9000807@selasky.org> <563CD533.2000909@selasky.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2015 16:43:53 -0000 On Fri, 2015-11-06 at 17:28 +0100, Hans Petter Selasky wrote: > Hi, > > I spent some time to write a test application to investigate this > issue > and I found some irregularities, that when > kern.eventtimer.periodic=0, > the timer appears to run very irregular. > > Test software: > ============== > > fetch > http://home.selasky.org:8192/privat/callout_test_dummynet.tar.gz > tar -zxvf callout_test_dummynet.tar.gz > cd callout_test_dummynet > make -m /usr/src/share/mk SYSDIR=/usr/src/sys all install > > Test I: > ======= > > The following settings are placed in /boot/loader.conf and computer > rebooted. > kern.hz=10000 > kern.eventtimer.periodic=1 > > kldload callout_test > > ./test.sh > debug.total: 32604 -> 0 > debug.total: 10021 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10019 -> 0 > debug.total: 10021 -> 0 > debug.total: 10020 -> 0 > debug.total: 10021 -> 0 > debug.total: 10019 -> 0 > debug.total: 10020 -> 0 > debug.total: 10018 -> 0 > debug.total: 10021 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > debug.total: 10020 -> 0 > > Test II: > ======== > > The following settings are placed in /boot/loader.conf and computer > rebooted. > kern.hz=10000 > kern.eventtimer.periodic=0 > > kldload callout_test > > ./test.sh > debug.total: 20337 -> 0 > debug.total: 10091 -> 0 > debug.total: 10018 -> 1 > debug.total: 10041 -> 0 > debug.total: 10019 -> 0 > debug.total: 10644 -> 0 > debug.total: 10014 -> 1 > debug.total: 10020 -> 0 > debug.total: 10019 -> 0 > debug.total: 10644 -> 0 > debug.total: 10014 -> 0 > debug.total: 10644 -> 0 > debug.total: 10640 -> 0 > debug.total: 10210 -> 0 > debug.total: 10015 -> 0 > debug.total: 10020 -> 1 > debug.total: 10020 -> 0 > debug.total: 10453 -> 0 > debug.total: 10642 -> 0 > > If you load the computer, like a multi-CPU buildkernel, the value > flattens out again. > > Test III: > ========= > The following settings are placed in /boot/loader.conf and computer > rebooted. > kern.hz=1000 > kern.eventtimer.periodic=1 > > kldload callout_test > > ./test.sh > debug.total: 5238 -> 0 > debug.total: 1005 -> 0 > debug.total: 1003 -> 0 > debug.total: 1006 -> 0 > debug.total: 1003 -> 0 > debug.total: 1003 -> 0 > debug.total: 1005 -> 0 > debug.total: 1006 -> 0 > debug.total: 1003 -> 0 > debug.total: 1013 -> 0 > debug.total: 1005 -> 0 > debug.total: 1006 -> 0 > debug.total: 1004 -> 0 > debug.total: 1005 -> 0 > debug.total: 1003 -> 0 > debug.total: 1004 -> 0 > debug.total: 1006 -> 0 > debug.total: 1004 -> 0 > debug.total: 1004 -> 0 > debug.total: 1007 -> 0 > debug.total: 1003 -> 0 > debug.total: 1004 -> 0 > > > The difference between 100021 and 10642 interrupts in a second for > test > II is quite big, close to 6.5% deviation. Does anyone have any clue > if > this is the expected behaviour when kern.eventtimer.periodic=1 or > not? > > MAV ? > > --HPS Do the test II results change with this setting? sysctl kern.timecounter.alloweddeviation=0 -- Ian