Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 10 Feb 2003 11:10:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 10 Feb 2003 11:10:05 -0500 Received: from chaos.analogic.com ([204.178.40.224]:55710 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id convert rfc822-to-8bit; Mon, 10 Feb 2003 11:10:02 -0500 Date: Mon, 10 Feb 2003 11:20:54 -0500 (EST) From: "Richard B. Johnson" Reply-To: root@chaos.analogic.com To: =?iso-8859-1?Q?J=F6rn?= Engel cc: Dan Parks , SA , linux-kernel@vger.kernel.org Subject: Re: interrupt latency ? In-Reply-To: <20030210154304.GA1973@wohnheim.fh-wedel.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2248 Lines: 55 On Mon, 10 Feb 2003, [iso-8859-1] J?rn Engel wrote: > On Mon, 10 February 2003 09:58:46 -0500, Dan Parks wrote: > > > > Do you happen to have a program (or kernel module...) that times these > > latencies? I've been trying to generate statistics about these kinds of > > latencies, and have yet to be happy with any of my tests. > > That should be impossible to do. :) > > Write a simple handler for parport or so, that is called when line #1 > toggles from low to high and responds by pulling line #2 from low to > high. > Now hook up a signal generator and an oszilloscope and measure the > time from signal generation to the physical reaction. > > This way you get all the latency, not just the small amount you can > measure inside the kernel. > > J?rn > Yes, and you will find that you can replicate a square-wave, through the hardware and software up to about 50 kHz with a 400 MHz Pentium if you disconnect your network during the tests. My tests, several years ago, in the ISR simply XOR-ed a saved copy of bit zero with `1` to toggle it and wrote it out the data port. This would occur at every IRQ7, generated by hitting bit 2 of the control port with a function generator. This should produce a symmetrical /2 when you look at bit 0. You can line up the starting 'high' of the function generator, with either a high or low of bit one (because it's /2) and measure the time, which from my notebook looks like 1.2 to 1.4 microseconds on a 400MHz machine. You can increase the interrupt rate until the machine is no longer able to keep up. This usually occurs around 110 kHz or higher. If you modify whatever Ethernet driver you are using to remove the loop in its ISR, you can get good results with the network connected. However, you will have poor results with any network driver that contains a loop in its ISR. Cheers, Dick Johnson Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips). Why is the government concerned about the lunatic fringe? Think about it. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/