From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F2BA61382C5 for ; Sat, 10 Feb 2018 19:02:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3F2ECE0A8E; Sat, 10 Feb 2018 19:02:46 +0000 (UTC) Received: from blaine.gmane.org (unknown [195.159.176.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B7B6CE0980 for ; Sat, 10 Feb 2018 19:02:45 +0000 (UTC) Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ekaNn-0002Fk-15 for gentoo-user@lists.gentoo.org; Sat, 10 Feb 2018 20:00:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Kai Krakow Subject: [gentoo-user] Re: /var/tmp on tmpfs Date: Sat, 10 Feb 2018 20:01:56 +0100 Message-ID: <46s3le-2ni.ln1@hurikhan77.spdns.de> References: <886dc935-5bef-e683-6780-bdaf0b66c500@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Pan/0.142 (He slipped to Sam a double gin; 01b5bf4 git.gnome.org/pan2) X-Archives-Salt: 7e67f963-14b3-4b27-b06b-194350e46717 X-Archives-Hash: d5383f23cc57a0227c5de8b1207eef3d Am Thu, 08 Feb 2018 14:50:31 -0500 schrieb Rich Freeman: > On Thu, Feb 8, 2018 at 2:17 PM, Dale wrote: >> As someone else pointed out, if you start using swap, that generally >> defeats the purpose of tmpfs. >> >> > I'll just add one thing to this, which I've probably already said ages > ago: > > In an ideal world swap would STILL be better than building on disk, > because it gives the kernel fewer constraints around what gets written > to disk. > > Anything written to disk MUST end up on the disk within the dirty > writeback time limit. Anything written to tmpfs doesn't ever have to > end up on disk, and if it is swapped the kernel need not do it in any > particular timeframe. Also, the swapfile doesn't need the same kinds of > integrity features as a filesystem, which probably lowers the cost of > writes somewhat (if nothing else after a reboot there is no need to run > tmpreaper on it). > > So, swapping SHOULD still be better than building on disk, because any > object file that doesn't end up being swapped is a saved disk IO, and > the stuff that does get swapped will hopefully get written at a more > opportune time vs forcing the kernel to stop what is doing after 30s (by > default) to make sure that something gets written no matter what (if it > wasn't deleted before then). I can only second this. > That's all in an ideal world. In practice I've never found the kernel > swapping algorithms to be the best in the world, and I've seen a lot of > situations where it hurts. I run without a swapfile for this reason. > It pains me to do it because I can think of a bunch of reasons why this > shouldn't help, and yet for whatever reason it does. I really prefer having inactive things being swapped out than discarding cache from memory. But since kernel 4.9 this no longer works so well. I'm still seeking the reason. But for that reason, building in tmpfs is no longer such an appealing option as before. Otherwise, I was quite happy with swap behavior, exactly for the reasons you initially outlined. -- Regards, Kai Replies to list-only preferred.