From owner-freebsd-arm@FreeBSD.ORG Sat Sep 7 14:40:40 2013 Return-Path: Delivered-To: freebsd-arm@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 E1E94DE7 for ; Sat, 7 Sep 2013 14:40:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B882B2505 for ; Sat, 7 Sep 2013 14:40:40 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VIJgl-000ACh-Cd; Sat, 07 Sep 2013 14:40:39 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r87EeaAt074549; Sat, 7 Sep 2013 08:40:36 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/esfIKcbHkW+nG0ZbG7Gwg Subject: Re: mmcsd on RPi From: Ian Lepore To: George Mitchell In-Reply-To: <522B35E9.2000002@m5p.com> References: <522B35E9.2000002@m5p.com> Content-Type: text/plain; charset="us-ascii" Date: Sat, 07 Sep 2013 08:40:36 -0600 Message-ID: <1378564836.1111.506.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "freebsd-arm@freebsd.org" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Sep 2013 14:40:40 -0000 On Sat, 2013-09-07 at 10:19 -0400, George Mitchell wrote: > While performing "disk" operations in the process of building ports on > my Raspberry Pi, I observe idle times in the 80-98% range, with the > processes doing the work in the biowr or biord states in the "top" > display. Interrupt time varies from 1-8% with system time in the 1-3% > range. Could this be due to my having a crappy SD card, or is it > inherent in the current mmcsd driver on ARM? Is there anything I can > do to help speed up the driver? > > My continuing thanks go to the many developers on the ARM project, and > especially the ones who have made the Raspberry Pi a viable FreeBSD > platform. -- George The sd driver on the rpi is in pretty good shape -- it does multi-block IO and uses DMA. A different card may perform better. Counter- intuitively, an older/smaller card may be better than the very latest. Random small writes are the worst-case scenario for sd cards, it drives them into doing a non-trivial amount of read-modify-write internally (writing anything from 1 sector to a 64k chunk can result in read, erase, rewrite of a much larger block, often in the megabytes). Newer cards tend to be optimized for the way cameras and hd-cams write data to a fat32 filesystem. That optimization doesn't do our ufs filesystems any favors. It's not unusual when running gstat against an sd device to see IO times averaging multiple seconds per write transaction. It's really taking dozens of milliseconds per individual write, and then the system's bio queue is so backed up that it takes 10 seconds or more to retire any given write. Reads also slow down when writes get backlogged, because the sdcard can only do one thing at a time. If you can arrange to have object files written to tmpfs during builds, that'll help a lot. -- Ian