From owner-freebsd-hackers Sat Nov 15 23:12:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA24007 for hackers-outgoing; Sat, 15 Nov 1997 23:12:14 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from trojanhorse.ml.org (mdean.vip.best.com [206.86.94.101]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA23999 for ; Sat, 15 Nov 1997 23:12:11 -0800 (PST) (envelope-from jamil@trojanhorse.ml.org) Received: from localhost (jamil@localhost) by trojanhorse.ml.org (8.8.8/8.8.5) with SMTP id XAA00656 for ; Sat, 15 Nov 1997 23:12:01 -0800 (PST) Date: Sat, 15 Nov 1997 23:12:01 -0800 (PST) From: "Jamil J. Weatherbee" To: freebsd-hackers@freebsd.org Subject: 20x increase in efficiency with Select() trigger optimization on AIOX driver In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Keep in mind that select returns as soon as a single entry is available in > any channels fifo. I am thinking about adding an ioctl() that would allow > the user to specify a select() trigger point, say they could tell the > driver to not do a selwakeup() unless the fifo is more than half full. Of I did some tests and found that increase fifo size to more than 64 entries had no significant effect on efficiency, however trigger code on the 64 entry fifo setting a trigger at 48 entries for selwakeup had a significant effect: The new figures Aggregrate Sample Frequency Percent Cpu Time <2000 hz Negligible (1%-10%) 3500 hz 15% 4000 hz Saturated It is very curious, I can run AD_MICRO_PERIOD down to 280 us with 15% cpu, so even running the user process rtprio, I can still log in to the machine and there is no noticeable effect in performance for other things. (i.e. it is still interactive) However set AD_MICRO_PERIOD down another 30us to 250us and the CPU is saturated, clearly a hardware limitation. Even huge fifos (x4 - x8) have no effect on this. The old figures > > Aggregate Sample Frequency Percent Cpu Time > > 32 hz 2% > 62.5 hz 3% > 125 hz 6.2% > 250 hz 12.5% > 500 hz 25% > 1000 hz 45% > 2000 hz 90% > 16000 hz Saturated But No Overruns > > The performance is linear (below saturation) and the sample freq to > percent cpu has a 99.9% correlation. The equation: > > %Cpu = 0.9477 + 0.044606*(Sample Freq) > > Gives a very good approximation of %Cpu > > I wonder just how much faster a PPro or Pentium is then a NexGen machine > (this is in purely integer performance since I am not doing any > calculations in the user process). >