From owner-freebsd-stable@FreeBSD.ORG Fri Jun 28 15:50:59 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F8DCDFD for ; Fri, 28 Jun 2013 15:50:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qc0-x230.google.com (mail-qc0-x230.google.com [IPv6:2607:f8b0:400d:c01::230]) by mx1.freebsd.org (Postfix) with ESMTP id 37BC513C7 for ; Fri, 28 Jun 2013 15:50:59 +0000 (UTC) Received: by mail-qc0-f176.google.com with SMTP id z10so1457753qcx.35 for ; Fri, 28 Jun 2013 08:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5XjansZ/4Vq1G9qh0nO+Gxyu14dUyYbp0P3PivZN/Zk=; b=IOhrZzSW6op4f0p+FU2htnWofxRhh97EXnl+8kf/YBwZQRwLEOtS04xjyBZUlwfou5 AKCcoWJrKP2t/Fhy5QnWJQ/li/pfoQMGsrK1RvfR5VhA4fdlaqcHO1rvcn7UXj9jKpBP muyHXbk1qADA+69tRCIaLE5w2g4GlHeBAksEWxRJPeqdO1nnYD3jEiduPpMoawVInl8d 4R8Yg0nWXv7Mugf5SYuCVHn8eWi78S+hc1z3HEO8lk9iaMQjjEVfgCKjedQ4P3alvXcD uaR2yfsQ8zSvbo5pfZfRjvMY3ujIE+wa+cu4LmOtQdz1gtJsPbcucd+bqaYAoNdG+Wqp SEPA== MIME-Version: 1.0 X-Received: by 10.224.167.133 with SMTP id q5mr18634099qay.2.1372434658733; Fri, 28 Jun 2013 08:50:58 -0700 (PDT) Received: by 10.49.37.226 with HTTP; Fri, 28 Jun 2013 08:50:58 -0700 (PDT) In-Reply-To: <20130628013827.GB28137@icarus.home.lan> References: <51CCACF5.5020901@jetcafe.org> <20130628013827.GB28137@icarus.home.lan> Date: Fri, 28 Jun 2013 09:50:58 -0600 Message-ID: Subject: Re: AHCI Patsburg SATA controller and slow transfer speed From: asomers@gmail.com To: Jeremy Chadwick Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2013 15:50:59 -0000 On Thu, Jun 27, 2013 at 7:38 PM, Jeremy Chadwick wrote: > On Thu, Jun 27, 2013 at 02:21:57PM -0700, Dave Hayes wrote: >> Greetings all. I'm on FreeBSD 9.1-STABLE #0 r251391M. I'm noticing >> two of my SATA disks are at half speed. Is this normal or is there >> some configuration I'm forgetting? >> >> # dmesg | grep -C 4 ahc >> ... >> ahci0: port >> 0x2070-0x2077,0x2060-0x2063,0x2050-0x2057,0x2040-0x2043,0x2020-0x203f >> mem 0xd0b00000-0xd0b007ff irq 21 at device 31.2 on pci0 >> ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported >> ahcich0: at channel 0 on ahci0 >> ahcich1: at channel 1 on ahci0 >> ahcich2: at channel 2 on ahci0 >> ahcich3: at channel 3 on ahci0 >> ahcich4: at channel 4 on ahci0 >> ahcich5: at channel 5 on ahci0 >> ... >> ada0: ATA-8 SATA 3.x device >> ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) >> ada0: Command Queueing enabled >> ada0: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) >> ada0: Previously was known as ad4 >> ada1 at ahcich1 bus 0 scbus1 target 0 lun 0 >> ada1: ATA-8 SATA 3.x device >> ada1: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) >> ada1: Command Queueing enabled >> ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) >> ada1: Previously was known as ad6 >> ada2 at ahcich2 bus 0 scbus2 target 0 lun 0 >> ada2: ATA-8 SATA 3.x device >> ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ^^^^^^^^^ >> ada2: Command Queueing enabled >> ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) >> ada2: Previously was known as ad8 >> ada3 at ahcich3 bus 0 scbus3 target 0 lun 0 >> ada3: ATA-8 SATA 3.x device >> ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ^^^^^^^^^^^ >> ada3: Command Queueing enabled >> ada3: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) >> ada3: Previously was known as ad10 >> # pciconf -lcvb >> ahci0@pci0:0:31:2: class=0x010601 card=0x35ae8086 >> chip=0x1d028086 rev=0x06 hdr=0x00 >> vendor = 'Intel Corporation' >> device = 'Patsburg 6-Port SATA AHCI Controller' >> class = mass storage >> subclass = SATA >> bar [10] = type I/O Port, range 32, base 0x2070, size 8, enabled >> bar [14] = type I/O Port, range 32, base 0x2060, size 4, enabled >> bar [18] = type I/O Port, range 32, base 0x2050, size 8, enabled >> bar [1c] = type I/O Port, range 32, base 0x2040, size 4, enabled >> bar [20] = type I/O Port, range 32, base 0x2020, size 32, enabled >> bar [24] = type Memory, range 32, base 0xd0b00000, size 2048, enabled >> cap 05[80] = MSI supports 1 message enabled with 1 message >> cap 01[70] = powerspec 3 supports D0 D3 current D0 >> cap 12[a8] = SATA Index-Data Pair >> cap 13[b0] = PCI Advanced Features: FLR TP >> >> Thanks for any insight provided. > > Intel Patsburg is otherwise known as Intel X79. The X79 > chipset/southbridge offers 6 SATA ports, 2 of which are SATA600, and the > remaining 4 are SATA300: > > http://en.wikipedia.org/wiki/Intel_X79 > > The intention of this was to offer 2 ports for people wanting to use > SSDs (which tend to throttle themselves based on negotiated PHY speed), > and a remaining 4 ports for MHDDs or ATAPI. You can, of course, use > whatever ports for whatever you want. > > More importantly (I think): your devices are MHDDs and will never be > able to reach SATA600 (or SATA300) speeds. Pure MHDDs which use SATA600 > PHYs are somewhat of a marketing gimmick (but my gut feeling is that the > MHDD vendors are choosing to narrow the number of on-disk SATA > controllers they use). Hybrid HDDs may benefit from faster PHYs. Not to detract from the important stuff on this thread, but faster PHYs are absolutely not a marketing gimmick for MHDDs. A fast PHY can benefit a slow HDD for two reasons: 1) Commands that can be satisfied by the HDD's cache will run at the PHY speed. This is especially significant with ZFS, which takes advantage of HDD write caches. 2) More importantly, SAS expanders and SATA port multipliers are circuit-switched devices, not packet-switched. This means that when the HBA is talking to a disk, the entire circuit is running at the speed of the lowest communicating PHY. So an HDD with a slower PHY than the HBA will basically waste the HBA's time. Or to put it another way, putting faster PHYs on slow HDDs allows more HDDs to be effectively used by a single HBA port. These concerns won't have much impact on the performance of a desktop with only one or two HDDs, but it's very important to RAID users. > > Next, this statement by ahci(4) then confuses the user: > >> ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported > > You see, when AHCI was invented, the existing idea was that all ports > would have the same speed (and that was the case at the time). Only > somewhat recently have some vendors begun to mix-match speeds on the > same controller -- like this one. > > The AHCI specification probably (I have not read it even recently) only > provides a number indicating "the total number of ports" followed by a > single number indicating "the speed". > > There may be support somewhere within AHCI to provide an updated way to > get more granular information, but I do not know if that's the case. > > If there is, FreeBSD's ahci(4) driver does not support such at this > time (see sys/dev/ahci/ahci.c around line 502 for the device_printf() > call and what the arguments are (specifically AHCI_CAP_ISS and > AHCI_CAP_NPMASK)). > > TL;DR -- Your motherboard offers 6 ports, 2 of which are SATA600, 4 of > which are SATA300, and despite the line shown above by FreeBSD not > matching reality, everything is working as designed. > > -- > | Jeremy Chadwick jdc@koitsu.org | > | UNIX Systems Administrator http://jdc.koitsu.org/ | > | Making life hard for others since 1977. PGP 4BD6C0CB | > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"