From owner-freebsd-arm@FreeBSD.ORG Wed Jul 2 14:49:04 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 3A4D06E9 for ; Wed, 2 Jul 2014 14:49:04 +0000 (UTC) Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2D772D76 for ; Wed, 2 Jul 2014 14:49:03 +0000 (UTC) Received: by mail-ie0-f169.google.com with SMTP id rl12so678928iec.14 for ; Wed, 02 Jul 2014 07:49:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=RZ/1vuNPGZ0Bn09/f+sVry5LKnxQ833hjuuX803XlY0=; b=RsMIZMEwbFeLwJyA62klG5dMggkZxvHfEkx1ziyG+Nl+Thm7NkjfIzYn7r0ZXlWs5f NOJvMg6Obwle8kkaYUXlWfSCsunDDfBa5OZDx8o2jbXdjXkxr1z5yZAqUnN9pBLNNeRg 5A4lORX2vBkqKIw3ZzzcYZ1F7kQVSa/J48xq6/xucVH+XVyaWHqnKzby15pxUQXARxSj KCA4LCrddOoK8Wjh5KxZv3UkovFjbIBEiw8062u8cxt3hpcWLchP/+jkbpAg+05K6Fe3 LVGNbIEJl4M7u5ACDrQdCCwMKdFIaqIHxKZjezSV2BFT/BivHl65GcQ7ZOnL6iAARpT1 5B6g== X-Gm-Message-State: ALoCoQk+xXReYJNR3fIs9bgHnCClNarAY1kMCnPrtYJFDn6xkB1LWOo60xB16FTPwP5SG9X2Pv90 X-Received: by 10.50.79.196 with SMTP id l4mr5359069igx.16.1404312542521; Wed, 02 Jul 2014 07:49:02 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ky9sm43967900igb.13.2014.07.02.07.49.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 07:49:01 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_BCF575E8-B9A5-4E90-AF57-EAF27CE0393B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: /tmp, /var/log, /var/tmp as /dev/md - why? From: Warner Losh In-Reply-To: <20140702022042.GG45513@funkthat.com> Date: Wed, 2 Jul 2014 08:49:22 -0600 Message-Id: <8756CB42-0B1B-4191-8A63-9D54FEE5D877@bsdimp.com> References: <201407011046.s61AkJpj006890@mech-cluster241.men.bris.ac.uk> <20140702022042.GG45513@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1878.2) 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: Wed, 02 Jul 2014 14:49:04 -0000 --Apple-Mail=_BCF575E8-B9A5-4E90-AF57-EAF27CE0393B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jul 1, 2014, at 8:20 PM, John-Mark Gurney wrote: > Anton Shterenlikht wrote this message on Tue, Jul 01, 2014 at 11:46 = +0100: >>> =46rom r.c.ladan@gmail.com Tue Jul 1 11:37:35 2014 >>>=20 >>> 2014-07-01 11:25 GMT+02:00 Anton Shterenlikht : >>>=20 >>>> Why is it a good idea to mount /tmp and some var dirs on memory = disks: >>>>=20 >>>> root@raspberry-pi:/usr/ports # df -m >>>> Filesystem 1M-blocks Used Avail Capacity Mounted on >>>> /dev/mmcsd0s2a 14694 777 12742 6% / >>>> devfs 0 0 0 100% /dev >>>> /dev/mmcsd0s1 16 3 13 20% /boot/msdos >>>> /dev/md0 28 4 22 16% /tmp >>>> /dev/md1 14 0 12 0% /var/log >>>> /dev/md2 4 0 4 0% /var/tmp >>>> root@raspberry-pi:/usr/ports # >>>>=20 >>>> Is this about speed or power, or maybe space? >>>>=20 >>>> Mostly write tear because you're using an SD card, and it improves = speed >>> too. >>=20 >> "write tear"? >> Is this a joke, or some technical term? >> I cannot find what it means. >=20 > it is a technical term, though I'd be surprised if any SD card had > an issue w/ that anymore=85 SD cards are made from NAND flash. NAND flash is different than a hard = disk in that it has only a limited number of times you can write to a = given spot before it becomes unusable (well, hard drives have this too, = but the numbers are huge (1e20 or something like that if memory serves). = This number can be as low as a few hundred for the really low-end cheap = crap parts, but typically is a few thousand. The reason for this is = because you have to erase each NAND page before you can program it, and = each time you erase it you expose the cell to a huge negative potential = voltage. This leads to trapping of electrons, as well as some minor = physical damage, usually along tiny flaws in the manufacturing process. = The net effect is that the dynamic range of the cell is reduced, which = leads to errors which eventually get bad enough that the pages become = useless. Since there=92s actual physical damage to each program/erase = cycle, it is referred to as =93wear and tear.=94 You=92ll see references = to =93wear leveling=94 which attempts to wear out each block at about = the same rate. > write tear is where when writing data, only part of the data gets > written and then you loose power... This is mostly an issue on flash > where you have to erase the data beforey ou can program it... Most > flash now have a layer of indirection so that they copy/write the > data to a new flash block, and then point the block there before > erasing the old data... (kinda like a log FS)=85 Yes, nearly all block devices based on flash have some kind of log-based = system under the covers. It is a shame they don=92t expose the log = directly, since a number of interesting optimizations could be made in = host software that are not possible going through the translation layer = a log-bsed system imposes on the card. But we get what we get... Warner --Apple-Mail=_BCF575E8-B9A5-4E90-AF57-EAF27CE0393B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTtBvyAAoJEGwc0Sh9sBEARMwP/jg2oo8B1pcn2rXvmkv8/FbJ 4Qcgr3VPrEoU6lKkbpBdbRPJN9lG+TSqZu0YT3ie6cG9bQ7A+Y5cc2a4zr+pav02 HeFsOU0IMsvZj1eePhaAS6Zz4naw3ZLG/9bE8sORCLMhXv2kKmyMg2Vi4PILq36m sMG1yRV+3ohP0YZ0enJwoAZ8h1HGrl/emOlXQgVL1+E2F5r8YGnWE0XgRc3n9qi2 lDGVVxQCRkLlTge8W+Fkh5lxqb1e0Tj4A8zpnhko/XkriFlM8nkn5vm6hfBHbqHW 9D61QxPoFnJa6sE0rB0wNpPk7D26njA0GoRKvNAcm6waBajlabZEDSPGif88oZv9 tshflFG4Z7AgCU03R2sv3w9fkKSR2NpAQOvjhMxUeBI26PXuY4KrnFu6aa8LeMVd /HjyM6kyUehOzCARGHDt1yGKAG9OSpQQqh8Fkai/kVY4OcGERPYf+OtAkqx25Ymj +cTihDVXlsVtO+OVAICqB6teeMWsZXOPEar1RmN+wCjHNstwdMnpt1Q7ud9kgxOW d/plyvwVkg0ulYvZa69sUrF8fe1XgErgLsW2ZX1wV968C5FNaCaoJB9df2a4M1ib BZA9TW2mtclzulMp5u4xcHCrqhL97sUkco7pE1K0EVJqOQtKNw4KSvENr/YrXb+k yPU18zre1L9bwvaUegon =igD5 -----END PGP SIGNATURE----- --Apple-Mail=_BCF575E8-B9A5-4E90-AF57-EAF27CE0393B--