From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 14 02:24:55 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D7D7D16A41C for ; Tue, 14 Jun 2005 02:24:55 +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 782A043D1F for ; Tue, 14 Jun 2005 02:24:55 +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 j5E2Tbt3008154; Mon, 13 Jun 2005 20:29:37 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <42AE3FEE.6040207@samsco.org> Date: Mon, 13 Jun 2005 20:24:46 -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: <200506131412.38967.hselasky@c2i.net> <20050613.172307.81090793.imp@bsdimp.com> In-Reply-To: <20050613.172307.81090793.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: freebsd-hackers@freebsd.org, hselasky@c2i.net Subject: Re: Obvious bug in /sys/i386/include/bus.h X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2005 02:24:56 -0000 M. Warner Losh wrote: > In message: <200506131412.38967.hselasky@c2i.net> > Hans Petter Selasky writes: > : So can someone have this fixed, or is there a reason not to fix it. The one > : who wrote the code has done the same mistake with every one of the > : bus_space_XXXX that does memory mapped I/O. It currently breaks my drivers. > > One isn't supposed to call these routines with count == 0. One could > say your drivers are broken :-) > > Back when these were written, small optimizations like this were made > to make things go faster. Now that cache sizes are bigger, a few > extra instructions likely wouldn't affect things too much. Best to > measure the effects of your proposed changes on real workloads... > > Warner I'm torn between saying, "this is the kernel and the kernel is an unforgiving mistress," and "defensive programming is good." We still have viable and popular platforms that are based on i486, so I'd rather not see us unwind the small optimizations that are still valid there. Scott