From owner-freebsd-net@freebsd.org Fri Nov 6 08:50:32 2015 Return-Path: Delivered-To: freebsd-net@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 8BA20A27653 for ; Fri, 6 Nov 2015 08:50:32 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1127C1BE1 for ; Fri, 6 Nov 2015 08:50:32 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by lbbkw15 with SMTP id kw15so47084129lbb.0 for ; Fri, 06 Nov 2015 00:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Qxtb/vNt0Kh2uCRI/MEah6TrxjPGP7K0H5pN/4CCoc4=; b=qkzrJ0+uJdxKbVCg7XDX1puvpJ3dpcnxxgj6CU5+mLePkbZHfbdtgHfb1ofi3a9IsL 46cx+1gHJ26a6RwCQLQLPyMhl16uPTD4xkbzRx8liLFzfwdSopSXTgM1LQxlXezOKwEM gUuHWBHjUv37K9x7uyyOORa6lZ92JtvYxGbD3cQ8f/4u2KXCYtEgZrg2MbsW8cNDswwb DPJyFuN+OaAOeCAuT2xmLQDTP+6uDfpPtqu1Tvb6J//mIhT9yV8T+zz760LXBPazPUzh /LViFBQWJLeiKWAnZvkUcVd792te3Rd0dvnKs2OPrh//a+YyQlwnpx70jRc5MxhvSTAK 35Vg== MIME-Version: 1.0 X-Received: by 10.112.180.230 with SMTP id dr6mr6179523lbc.72.1446799830227; Fri, 06 Nov 2015 00:50:30 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.78.3 with HTTP; Fri, 6 Nov 2015 00:50:30 -0800 (PST) In-Reply-To: <563C6864.2090907@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> Date: Fri, 6 Nov 2015 09:50:30 +0100 X-Google-Sender-Auth: Zv6ExREoqnR0XtdvrePTnCWegBc Message-ID: Subject: Re: Timing issue with Dummynet on high kernel timer interrupt From: Luigi Rizzo To: Hans Petter Selasky Cc: Rasool Al-Saadi , "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2015 08:50:32 -0000 On Fri, Nov 6, 2015 at 9:44 AM, Hans Petter Selasky wrote: > On 11/06/15 01:08, Rasool Al-Saadi wrote: >> >> >> On Thursday, 5 November 2015 8:53 PM, Hans Petter Selasky wrote: >>> >>> >>> On 11/05/15 00:44, Rasool Al-Saadi wrote: ... >> Removing C_HARDCLOCK reduces the problem but doesn't solve it completely. >> However, removing C_DIRECT_EXEC instead solves the problem (but >> occasionally very small spike(s) appears in high hz values). >> I mentioned in my first email that removing these flags makes the issue to >> disappear. But what the effects of removing these flags? If it cause timing >> issue to Dummynet, why we should use them? >> > > Hi, > > The C_DIRECT_EXEC flag reduces task switching overhead, that you don't have > to wakeup a thread to wakeup the dummynet worker thread. It affects timing. Hans, thanks for the explanation. Can you clarify the behaviour of C_DIRECT_EXEC ? Does this mean that the task is run within some common thread instead of a dedicated one ? If so, for this type of task (dummynet may run at high rate and use a significant amount of cpu time) it may be a good idea to remove C_DIRECT_EXEC altogether. cheers luigi