From owner-freebsd-questions@FreeBSD.ORG Sat Oct 22 21:08:37 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2410316A41F for ; Sat, 22 Oct 2005 21:08:37 +0000 (GMT) (envelope-from snafu6002@hotmail.com) Received: from hotmail.com (bay17-f16.bay17.hotmail.com [64.4.43.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEF5943D45 for ; Sat, 22 Oct 2005 21:08:36 +0000 (GMT) (envelope-from snafu6002@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 22 Oct 2005 14:08:36 -0700 Message-ID: Received: from 82.169.21.157 by by17fd.bay17.hotmail.msn.com with HTTP; Sat, 22 Oct 2005 21:08:36 GMT X-Originating-IP: [82.169.21.157] X-Originating-Email: [snafu6002@hotmail.com] X-Sender: snafu6002@hotmail.com From: "Sna Fu" To: freebsd-questions@freebsd.org Date: Sat, 22 Oct 2005 21:08:36 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed X-OriginalArrivalTime: 22 Oct 2005 21:08:36.0763 (UTC) FILETIME=[C4B54EB0:01C5D74C] Subject: Disks using DMA causing high CPU usage X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2005 21:08:37 -0000 Hi, I installed a Maxtor 250Gb ATA133 drive in my FreeBSD machine just yet, and after doing the common stuff it came up and running just fine. Curious as I am I decided to do some benchmarks (Bonnie++) to see if a 16Mb cache affected performance, but much to my surprise I saw that the drive was using up to 99% of my CPU! Here is the Bonnie output: File './Bonnie.7724', size: 104857600 [snip] -------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU 100 15326 50.3 14596 24.5 17190 27.8 42274 99.0 132574 99.2 13326.4 98.0 [snip] As you can see, the CPU usage is quite high and the drive throughput is not what I expected either, but I'm not sure if those are normal rates. Anyway, the ouput that Bonnie gave me lead me to believe that the drive might not be using DMA at all, so I checked this using atacontrol: [snip] ATA channel 1: Master: ad2 ATA/ATAPI revision 7 Slave: acd0 ATA/ATAPI revision 0 Master = UDMA66 Slave = UDMA33 [snip] So much for this drive, but I found that both drives on ATA channel 0 were having the same issue! Both are awfully CPU-intensive when under load, however I am using a fairly old DMA cable (40 pins) so both disks are running on UDMA33. Yet, they *are* using DMA so at least I would've expected a lower CPU utilisation - or am I dead wrong there? Relevant dmesg output follows: [snip] atapci0: port 0xf000-0xf00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 31.1 on pci0 ata0: channel #0 on atapci0 ata1: channel #1 on atapci0 ata0-master: DMA limited to UDMA33, non-ATA66 cable or device ata0-slave: DMA limited to UDMA33, non-ATA66 cable or device ad0: 78167MB [158816/16/63] at ata0-master UDMA33 ad1: 78167MB [158816/16/63] at ata0-slave UDMA33 ad2: 239372MB [486344/16/63] at ata1-master UDMA66 acd0: CDROM at ata1-slave PIO4 [/snip] The machine and disks (sans the 250gb one) performed fine when I was still running Linux, albeit after some tweaking with hdparm (i.e. enabling 32-bit transfer mode). My questions in a nutshell: Why is my transfer rate so disappointing, and why is my CPU usage so enormously high when the disks are being put to work? I'm out of ideas, I hope anybody can help. Thanks in advance, Dan(iel) Eisenhower _________________________________________________________________ Spel spelletjes met je online vrienden via MSN Messenger http://messenger.msn.nl/