From owner-freebsd-arch@FreeBSD.ORG Mon May 30 17:57:30 2005 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A68A916A41F for ; Mon, 30 May 2005 17:57:30 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F40143D48 for ; Mon, 30 May 2005 17:57:30 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.3/8.13.3) with ESMTP id j4UI4h4v004965; Mon, 30 May 2005 12:04:43 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <429B53D3.4060806@samsco.org> Date: Mon, 30 May 2005 11:56:35 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050218 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <20050525.212009.71136852.nyan@jp.FreeBSD.org> <20050525.111945.41668351.imp@bsdimp.com> <4299FD87.1000505@samsco.org> <20050529.235203.74669295.imp@bsdimp.com> In-Reply-To: <20050529.235203.74669295.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org Cc: gibbs@scsiguy.com, arch@FreeBSD.org, nyan@jp.FreeBSD.org Subject: Re: [RFC] remove bus_memio.h and bus_pio.h X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2005 17:57:30 -0000 M. Warner Losh wrote: > In message: <4299FD87.1000505@samsco.org> > Scott Long writes: > : This kind of makes me sad. I don't see how this was harming anything, > : it just wasn't documented so people didn't know how to use it. If it > : didn't apply to non-i386 and amd64, fine, just don't implement it for > : those platform. This optimization might have seemed trivial, but it's > : all of the little trivial optimizations that add up to make a nice > : system. I'm guessing that Justin only put effort into this originally > : because he did see a benefit; discounting it without doing any testing > : of your own is a bit disingenuous. > > I've been unable to measure any difference in any of timing solution's > drivers between having the bus_pio.h include and not having it at all > (which disables the optimization). This is on a 266MHz Pentium. I'm > guessing that the drivers did inb/outb/etc so infrequently that any > benefit was swamped by the actual I/O. Even at the maximum data rates > that we could see (which did about 20k inb/outb a second) I couldn't > measure any CPU difference, nor could I measure any performance > difference. I did this in the 4.3 time frame in our tree when looking > to optimize a driver that was giving us trouble. A back of the > envelope calculation suggests that I should have seen about 100us/s of > extra CPU time. Since I ran the tests for about 1000 seconds, I > should have seen .1s extra in CPU. Maybe I did, but iirc the standard > deviation of the measurements as much more than that. I'll see if I > can find the data I gathered at the time. > > I've not measured anything with memio to see if that matters, or if > there is anything different about newer pentiums and the branching > effects. However, when Justin introduced them in the 3.0 time frame, > which is 1998. According to Intel's web site, the Pentium II had just > been introduced, which puts the CPU speeds at just a little faster > than the embedded systems we run at work. I also recall discussions > with Justin at the time that said the biggest win was for 386 and 486 > machines, but I might be misremembering those discussions, since they > were over lunch about 7 years ago. > > Warner Thanks for the explaination. One thing to note is that the Soekris is still a very popular platform, so this optimization might still be very relevant there. Even so, it was basically free, and the only thing it lacked was documentation so that people could use it correctly. It's a shame that it's gone. Scott