From owner-freebsd-arm@FreeBSD.ORG Thu Jul 3 14:07:56 2014 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 ESMTPS id 75C0DCD8 for ; Thu, 3 Jul 2014 14:07:56 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4848B2C87 for ; Thu, 3 Jul 2014 14:07:56 +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 1X2hfx-000L17-9Y; Thu, 03 Jul 2014 14:07:49 +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 s63E7j5K001246; Thu, 3 Jul 2014 08:07:45 -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: U2FsdGVkX18dRbW9ABnZUARIalIyngZb Subject: Re: /tmp, /var/log, /var/tmp as /dev/md - why? From: Ian Lepore To: John Hay In-Reply-To: <20140703105519.GA37593@zibbi.meraka.csir.co.za> References: <201407010925.s619PHeT006679@mech-cluster241.men.bris.ac.uk> <44a6e8a451a.810fa8f@mail.schwarzes.net> <53B3EB29.4030908@gmail.com> <20140703105519.GA37593@zibbi.meraka.csir.co.za> Content-Type: text/plain; charset="us-ascii" Date: Thu, 03 Jul 2014 08:07:44 -0600 Message-ID: <1404396464.20883.404.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.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 14:07:56 -0000 On Thu, 2014-07-03 at 12:55 +0200, John Hay wrote: > On Thu, Jul 03, 2014 at 04:47:24AM -0600, Warren Block wrote: > > On Wed, 2 Jul 2014, Mattia Rossi wrote: > > > > > > > > Am 01.07.2014 21:27, schrieb Andreas Schwarz: > > >> Speed and speed, but I can't understand why using md here, there is already > > >> tmpfs, > > >> which optimzed for such cases (dynamic allocation, etc.). > > >> > > >> root@pizelot:~ # df > > >> Filesystem 1K-blocks Used Avail Capacity Mounted on > > >> /dev/mmcsd0s2a 983680 57252 847736 6% / > > >> devfs 1 1 0 100% /dev > > >> /dev/mmcsd0s2d 8106716 3068708 4389472 41% /usr > > >> /dev/mmcsd0s2e 8106716 155976 7302204 2% /var > > >> /dev/mmcsd0s2f 8106716236 7457944 0% /home > > >> tmpfs 1097160 4 1097156 0% /tmp > > >> tmpfs 1097160 4 1097156 0% /var/tmp > > >> > > > > > > On an embedded systems with little memory I prefer to limit the partitions to > > > a certain size, like 32M, so dynamic allocation is no advantage. What other > > > differences are there between tmpfs and a simple md device? > > > I'd be interested in knowing any tricks, that can make the system faster :-) > > > > The white paper on tmpfs (wiki.deimos.fr/images/1/1e/Solaris_tmpfs.pdf) > > says: > > > > "RAM disks use memory inefficiently; file data exists twice in both > > RAM disk memory and kernel memory, and RAM disk memory that is not > > being used by the file system is wasted. RAM disk memory is > > maintained separately from kernel memory, so that multiple > > memory-to-memory copies are needed to update file system data." > > > > So a limited-size tmpfs will be faster and use less memory overall. A > > benchmark comparison would be interesting. > > Last time I looked the rc scripts that create /etc, /var and /tmp > ramdisks only did it using md devices. It would be great if it was > easily tunable from say rc.conf or if could detect which one is > available and use that. > > John I have patches ready to commit that do exactly that, but they weren't exactly enthusiastically received when I posted them on arch@ for review. -- Ian