From owner-freebsd-arm@FreeBSD.ORG Thu Jul 3 10:55:29 2014 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 ESMTPS id 0E61F7CC for ; Thu, 3 Jul 2014 10:55:29 +0000 (UTC) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [146.64.24.58]) by mx1.freebsd.org (Postfix) with ESMTP id 9A9E228DB for ; Thu, 3 Jul 2014 10:55:28 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id B94C3B843; Thu, 3 Jul 2014 12:55:19 +0200 (SAST) Date: Thu, 3 Jul 2014 12:55:19 +0200 From: John Hay To: Warren Block Subject: Re: /tmp, /var/log, /var/tmp as /dev/md - why? Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 10:55:29 -0000 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 -- John Hay -- jhay@meraka.csir.co.za / jhay@meraka.org.za