From owner-freebsd-net@FreeBSD.ORG Sun Dec 9 01:12:05 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A406916A418 for ; Sun, 9 Dec 2007 01:12:05 +0000 (UTC) (envelope-from sandiegobiker@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.191]) by mx1.freebsd.org (Postfix) with ESMTP id 75BE713C447 for ; Sun, 9 Dec 2007 01:12:05 +0000 (UTC) (envelope-from sandiegobiker@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so1305943rvb for ; Sat, 08 Dec 2007 17:12:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=ezs/mrAjitb7hfFIrj9i2ceFssEBZ6bc1cRA0EhGbNY=; b=dty/fPf7H4FaUoTEfY4ocU7p+DwXStox6RlgjT92lPlL1dDiZgFoUN52Hoq5ml3+9Wh/wC8KXtDL3nWYX1ErzdlMlgFqQVOFBNQzAXLrNtCBjyqFpEV1tBNA4iBIyWntyed42IZgznImtMQS3NUDwAlTKD/3TYsK1h22t0omROM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=aaQlinCu4YvBh2GPrl0VoOfxCH1Yv8xsKQI4XAhcdEXig4K5ycJQwKpcoQAjUelhulj+KM5Wo+AcOqfdPwmUZjuIQx9D6/V1qXFnA9VEm34Db/jKVC0h8DzRRebyK9vBd/cnz6KLnUt/vZNw+vnae8OTvwzfVJQEXLyU8OAiNMs= Received: by 10.141.43.5 with SMTP id v5mr1146204rvj.1197162724920; Sat, 08 Dec 2007 17:12:04 -0800 (PST) Received: by 10.141.35.8 with HTTP; Sat, 8 Dec 2007 17:12:04 -0800 (PST) Message-ID: <27cb3ada0712081712o26e33d75y48f71f881b51b6d3@mail.gmail.com> Date: Sat, 8 Dec 2007 17:12:04 -0800 From: "Len Gross" To: "Harti Brandt" In-Reply-To: <20071207113727.J30903@knop-beagle.kn.op.dlr.de> MIME-Version: 1.0 References: <27cb3ada0712061914g4aff5a7eq7d5cc64ba3d493ed@mail.gmail.com> <47591EC2.9060902@FreeBSD.org> <20071207113727.J30903@knop-beagle.kn.op.dlr.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-net@freebsd.org" , "Bruce M. Simpson" Subject: Re: TDMA / Interrupts / Pre-emptible X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2007 01:12:05 -0000 On Dec 7, 2007 2:46 AM, Harti Brandt wrote: > On Fri, 7 Dec 2007, Bruce M. Simpson wrote: > > BMS>I can't comment on kernel scheduler jitter though, so someone who is > working > BMS>directly in that area will hopefully respond -- arch@ or hackers@ > might be a > BMS>better place to field that question. > BMS> > BMS>I believe microsecond resolution for your app should be possible in > the > BMS>kernel. If it isn't, I'd like to know why. [It would be really, really > nice > BMS>to have better real-time support in FreeBSD, i.e. a deadline > scheduler.] > > A couple of years I did exactly the same as the OP - implementing a > satellite MAC layer (FM-TDMA) on a cluster of 5 FreeBSD machines. I think > it was the time when we moved from 4.X to 5.0 or 5.1. I could not get it > reliable because the jitter in the kernel (I implemented everything in > netgraph over ethernet) was in the order of several 100 usec. I had HZ at > 10000 (all my simulation machines run on that). I tried really hard to > find out where these jitters came from, but failed. Trying to trace the > timing of execution changed the figures completely each time. Finally I > gave up, because the project luckily ended :-/ At one point I tried to > bump HZ to 20000 or so, but at this point TCP broke. I think this might > have come from the RTT computation which is/was done in ticks and the > square of something would overflow the variable. > > One must also carefully choose the ethernet adapter for this kind of > things, because it may add any kind of jitter/delay. At that time the best > where the DEC/intel if_dc types. > > Of course with the actual kernel the situation may be quite different. > Don't know what influence have interrupt threads and this stuff. I would > be interested to hear how things work out and, yeah, better real-time > support would be great :-) > > Regards, > harti > > I think the general answer is probably that drivers and Kernel code have the same lack of determinism as user-land code. I found a LINUX article "A measurement- based Analysis of the real-time performance of LINUX" that seems to support this view. If I can get latency/jitter of 100 microseconds that would be good enough for my next step. Will keep you posted. -- Len