From owner-freebsd-performance@FreeBSD.ORG Tue Feb 8 06:40:33 2005 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD22616A4FC for ; Tue, 8 Feb 2005 06:40:32 +0000 (GMT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DCBB43D2D for ; Tue, 8 Feb 2005 06:40:32 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])j186eUHn029337; Tue, 8 Feb 2005 17:40:30 +1100 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) j186eSVU019647; Tue, 8 Feb 2005 17:40:29 +1100 Date: Tue, 8 Feb 2005 17:40:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Andrey Smagin In-Reply-To: Message-ID: <20050208164546.W21504@delplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-performance@FreeBSD.org Subject: Re: My notices about ATA performance X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2005 06:40:33 -0000 On Mon, 7 Feb 2005, Andrey Smagin wrote: > I have 2 PC. > 1. iP 166 (RAM 48Mb) > 2. Duron 1133 (RAM 1Gb) > > 2 HDD - WD and Seagate (120GB/8Mb cache). These newer drives shouldn't be the bottleneck, especially with older CPUs (and motherboards?). > Kernels used > FreeBSD 4.8 RELEASE > FreeBSD 5.1 RELEASE > FreeBSD 6.0 CURRENT (1-2 week old) > > Test speed of copying 1 large (600Mb) file > from 1 HDD to another. To test only ATA, copy between (raw) partitions. Using whole/large partitions is easiest, but the i/o size doesn't need to be nearly as large as for a file since the (FreeBSD) disk cache is not involved. > If put HDD's on PC 1 > under 4.8 - 7-10 MBytes/s (UDMA33)(60%CPU Usage) > under 5.1 - 2.7-3 MBytes/s (UDMA33)(100%CPU Usage) > under 6.0 - 2.7-3 MBytes/s (UDMA33)(100%CPU Usage) 60% may be too high. 100% is too high. Check that UDMA33 is actually enabled, and where the CPU usage is. The latter is easier under 5.x+ using top -S. If the problem is interrupt overhead due to not using DMA, then it is easy to verify using systat -v. > If put better CPU K6-2-233 on PC 1 then speed of copying increased > under 5.1 - 3.2-4 MBytes/s (UDMA33)(100%CPU Usage) > under 6.0 - 3.2-4 MBytes/s (UDMA33)(100%CPU Usage) I have a K6-1-233 handy for testing and noticed a drop loss of performance a year or 2 ago between RELENG_4 and RELENG_5 or possibly between ATA and ATAng on it in ATAng a year or two ago, and breakage by ATAng a little later (see below). I suspect the problem is loss of support for correct DMA timing on the old VIA motherboard on this system. The problem may be increased by the system's drive also being old and slow: % atapci0: port 0x6000-0x600f at device 7.1 on pci0 % ad0: 407MB [1002/16/52] at ata0-master WDMA0 % acd0: CDROM at ata0-slave PIO3 This drive has interesting behaviour related to DMA: - it doesn't claim to support DMA. It is so old (bought in 1995 as a cheap replacement for a failing drive?) that it doesn't support most of the feature bits in the ATA standard. However, DMA used to worked perfectly with it using the old wd driver, provided DMA was forcibly configured. IIRC, it worked OK using the ata driver too until ATAng. The above dmesg output shows that ata now decides to use DMA although the drive doesn't claim to support DMA. However, the drive stopped working in DMA starting with ATAng (DMA mode gives write errors). I work around this by putting the drive in PIO mode in /etc/rc.early: % atacontrol mode 0 PIO2 PIO3 This gives large CPU overhead instead. About 60% for reading at the slow reading at the slow rate of 1MB/sec. The drive can only do 2MB/sec at best and gets close to that in DMA mode. Your newer drives shouldn't have this problem, but the old motherboard might. > If put HDD's on PC 2 > under 4.8 not tested > under 5.1 - 34-41 MBytes/s (UDMA100)(~30%CPU Usage) > under 6.0 - 33-41 MBytes/s (UDMA100)(~30%CPU Usage) This is close to normal. DMA mode takes very little CPU. The slower CPUs are overloaded by 50MB/sec disks for copying the data to and from userland (a K6-1-233 can only copy at 40MB/sec), but they shouldn't have 100% cpu usage for file copies at only 2.7-4MB/sec. > Why speed of IO operations very depend from CPU power in 5x and 6.x ? 6.x has more pessimizations. However, these should have only small effects for disk i/o and other i/o operations that involve large (larger than a few KB) buffers. Bruce