From owner-freebsd-questions@freebsd.org Thu Oct 19 08:36:19 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4933CE33828 for ; Thu, 19 Oct 2017 08:36:19 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bs1.fjl.org.uk", Issuer "bs1.fjl.org.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E70091102 for ; Thu, 19 Oct 2017 08:36:18 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from [192.168.1.186] (host81-134-87-65.range81-130.btcentralplus.com [81.134.87.65]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id v9J8a3Xg021752 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO) for ; Thu, 19 Oct 2017 09:36:04 +0100 (BST) (envelope-from frank2@fjl.co.uk) User-Agent: K-9 Mail for Android In-Reply-To: <20171018211136.2f143b1a@gumby.homeunix.com> References: <20171018164559.GA3267@anza.vindaloo.com> <20171018211136.2f143b1a@gumby.homeunix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: Md based tmpfs with zfs root system. From: "Frank Leonhardt (m)" Date: Thu, 19 Oct 2017 09:35:52 +0100 To: freebsd-questions@freebsd.org Message-ID: X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 08:36:19 -0000 On 18 October 2017 21:11:36 BST, RW via freebsd-questions wrote: >On Wed, 18 Oct 2017 12:45:59 -0400 >Christopher Sean Hilton wrote: > >> Good day, >> >> I've using a new system with root on zfs. I've traditionally used a >> /dev/md* based tmpfs for /tmp. A little initial reading on the >subject >> shows an argument about this practice but I didn't find any threads >> that provide a resolution. > > >md devices and tmpfs are two different things. tmpfs is a bit like an >md device, but it has its own built-in file-system, so it only uses >memory for current files, whereas an md device stores all the sectors >that have ever been written to, even if they hold deleted files. > >I don't follow ZFS much, but unless there is a specific reason not to >use tmpfs with zfs it's preferred over md devices. > >If the issue is the use of swap with zfs, neither tmpfs nor >swap-backed md devices actually require swap. My thought on reading the original question was to wonder what the ZFS ARC does with MDs. Does it result in double caching in RAM, or does something clever happen? I suspect the former. Using tempfs will probably take a bigger hit in low RAM situations (as it pages), but if you are short of RAM you'd be optimising the wrong thing with a RAM disk anyway. Does anyone remember if there is a POSIX requirement for /tmp to be nonvolatile? -- Sent from my Android device with K-9 Mail. Please excuse my brevity.