From owner-freebsd-current@FreeBSD.ORG Mon Jan 3 19:54:15 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8362816A4CE for ; Mon, 3 Jan 2005 19:54:15 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37A4243D54 for ; Mon, 3 Jan 2005 19:54:15 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.34] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id j03Js4GV028092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 3 Jan 2005 11:54:05 -0800 Message-ID: <41D9A2CF.30704@root.org> Date: Mon, 03 Jan 2005 11:53:51 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?S=F8ren_Schmidt?= References: <41D984A5.7010408@root.org> <41D99FBD.8070500@DeepCore.dk> In-Reply-To: <41D99FBD.8070500@DeepCore.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: FreeBSD Current Subject: Re: ATA rman performance enhancement X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2005 19:54:15 -0000 Søren Schmidt wrote: > Nate Lawson wrote: > >> While doing some benchmarking of other code, I noticed that there were >> a lot of calls to rman_get_bustag/handle(). They weren't taking up >> much actual time since they're pretty lightweight but seemed to be >> unnecessary. >> >> I worked up the attached diff and benchmarked it. There are about >> 1000 calls a second to the rman routines without this patch and >> essentially none with it. It makes about a 1% difference in >> throughput under some IO loads. It is only for non-Promise or non-SII >> controllers right now since I didn't extend the initialization step to >> more than ata-pci.c. The same approach could be used for the other >> INW/OUTW calls as well but they're not in the fast path. I think it >> may make more of a difference with small reads. >> >> Feel free to test, cleanup, and commit. > > > I had something semilar to this once back when, but since HW got lots > faster I couldn't measure it anymore, but maybe things has changed... > > Anyhow it needs to be applied to ata-isa.c ata-card.c ata-cbus.c etc to > not break anything at least. Yes, I agree. I limited the change only to the IDX macros that were used in the fast path although it could apply to all of them. > I'll think about it and eventually do > something about it in ATA-mkIII if it really is mesureable again.. It is a minimal difference but with small transfers on a fast drive with a low-powered CPU, it's measurable. I made the same change a while back in acpi_timer.c since the resource is only allocated once but accessed very often and in a low-latency context. -- Nate