From nobody@FreeBSD.org  Tue Oct  8 00:39:37 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id CDFBAD23
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Oct 2013 00:39:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id BBE5621BD
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Oct 2013 00:39:37 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r980dbxY075922
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 8 Oct 2013 00:39:37 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r980dbtu075918;
	Tue, 8 Oct 2013 00:39:37 GMT
	(envelope-from nobody)
Message-Id: <201310080039.r980dbtu075918@oldred.freebsd.org>
Date: Tue, 8 Oct 2013 00:39:37 GMT
From: Adam McDougall <mcdouga9@egr.msu.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Slow writes to AHCI SATA on Soekris net6501 (Intel EG20T) in *BSD
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         182818
>Category:       kern
>Synopsis:       [ata] [ahci] Slow writes to AHCI SATA on Soekris net6501 (Intel EG20T) in *BSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 08 00:40:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Sun Apr 20 03:59:40 UTC 2014
>Originator:     Adam McDougall
>Release:        10.0-ALPHA2
>Organization:
>Environment:
FreeBSD hoegaarden 10.0-ALPHA2 FreeBSD 10.0-ALPHA2 #0 r255793: Sun Sep 22 17:05:25 EDT 2013     root@build9:/usr/obj/proto/src10/src/sys/AMD64-10  amd64
>Description:
I discovered these symptoms initially on 9.x, and this weekend upgraded to 10 just to check for improvement.

The total AHCI SATA write speed on the net6501 (*BSD only?)
has a strange 20MB/sec limitation but reads can go over 100MB/sec.  If I
write to one disk I get 20MB/sec, but if I write to both SATA disks (such as mirroring) I get 10MB/sec each for a total of 20.  Writes are equally slow on a high end SSD.  Both someone running OpenBSD and I running FreeBSD reported the same symptoms to the soekris-tech mailing list and received no useful replies towards getting that problem solved.  I believe I duplicated the symptoms on NetBSD.  I tested the write speed briefly with Linux and it did not appear to have the 20MB/sec limitation (I wrote enough data that I was satisfied it could not be cached in ram).  I did confirm it was using MSI of some form with boot -v.  The disks I tested with are fine in normal computers.  I have three of these systems.  They are all acting as firewalls where write speed is not critical to operation, although one is considered a spare that I can experiment with.  They are not my property so I don't think I can mail one for personal inspection.
>How-To-Repeat:
Use something (dd?) to write to the raw devices or to a filesystem, use gstat -I 50000 to confirm a total limitation of 20MB/sec disk IO whether it is to one disk or two (10 each).
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
