From owner-freebsd-arm@FreeBSD.ORG Sat Sep 7 16:31:49 2013 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6F42DBD2; Sat, 7 Sep 2013 16:31:49 +0000 (UTC) (envelope-from george+freebsd@m5p.com) Received: from mailhost.m5p.com (ip-2-1-0-2.r03.asbnva02.us.ce.gin.ntt.net [IPv6:2001:418:0:5000::16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CF582928; Sat, 7 Sep 2013 16:31:48 +0000 (UTC) Received: from wonderland.m5p.com (localhost [IPv6:::1]) by mailhost.m5p.com (8.14.5/8.14.5) with ESMTP id r87GVfB7019634; Sat, 7 Sep 2013 12:31:46 -0400 (EDT) (envelope-from george+freebsd@m5p.com) Message-ID: <522B54ED.4090902@m5p.com> Date: Sat, 07 Sep 2013 12:31:41 -0400 From: George Mitchell User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130716 Thunderbird/17.0.7 MIME-Version: 1.0 To: Ian Lepore Subject: Re: mmcsd on RPi References: <522B35E9.2000002@m5p.com> <1378564836.1111.506.camel@revolution.hippie.lan> In-Reply-To: <1378564836.1111.506.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.73 on 10.100.0.3 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (mailhost.m5p.com [IPv6:::1]); Sat, 07 Sep 2013 12:31:47 -0400 (EDT) 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 16:31:49 -0000 On 09/07/13 10:40, Ian Lepore wrote: > 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 > Thanks for the explanation and the hint. -- George