Date: Mon, 2 Apr 2012 03:59:33 -0700 From: David Wolfskill <david@catwhisker.org> To: Gleb Kurtsou <gleb.kurtsou@gmail.com> Cc: Current FreeBSD <freebsd-current@freebsd.org> Subject: Re: Using TMPFS for /tmp and /var/run? Message-ID: <20120402105933.GC1420@albert.catwhisker.org> In-Reply-To: <20120402103119.GA2389@reks> References: <4F746F1E.6090702@mail.zedat.fu-berlin.de> <20120329161452.GZ1709@albert.catwhisker.org> <4F74BCD5.4040609@zedat.fu-berlin.de> <20120402103119.GA2389@reks>
next in thread | previous in thread | raw e-mail | index | archive | help
--xo44VMWPx7vlQ2+2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 02, 2012 at 01:31:19PM +0300, Gleb Kurtsou wrote: > ... > > > In any case, effective maximum usable size for tmpfs involves SIZE_= MAX > > > (~4G) & PAGE_SIZE (4K, in my case). >=20 > size_t is 64-bit on 64-bit archs. OK. Still, the requirement that the "size" specification be in "bytes" is awkward (in my experience) -- and I was using i386. > > > * Even when I went ahead and created a tmpfs for /tmp, I'd get ENOSPC > > > whenever I tried to allocate anything on it -- until I dropped the > > > size specification to <2G (2**32). Well, 2GB for /tmp just wasn't = at > > > all likely to be useful for my purposes in this case. >=20 > Are you using ZFS alongside tmpfs? It should be fixed in 9-STABLE. I have not tried ZFS yet. I don't expect to do so unless I switch to amd64. > ... > > It seems there is only one switch which determines the size of the tmpfs > > in question (size) and there is no convenient way to say what amount of > > RAM is being used before using the swap space. I'd like to have at least > > a knob determining the limit of RAM being used. >=20 > There is no way to force tmpfs to use given amount of RAM only. It's VM > subsystem that decides what pages to swap. Although some tweaking for VM > to prefer swapping tmpfs pages prior to process pages would be nice. >=20 > You could try the patch attached. It adds support for size option suffixes > (like 1g) and introduces swap limit (part of the older patch, not sure > if it's any use). >=20 > Patch is against 10-CURRENT. > Older version: https://github.com/glk/freebsd-head/commit/3bd8f7d > ... I'll plan to try this on a currrently-underutilized slice on my laptop, then -- thanks! :-) Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --xo44VMWPx7vlQ2+2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk95hpQACgkQmprOCmdXAD3QpwCfY5ttyGPGSWrCdlaLAHfcSW0Q NGoAn14hw5+7g5UJ6qTNVa7XgfL31D4W =2gJM -----END PGP SIGNATURE----- --xo44VMWPx7vlQ2+2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120402105933.GC1420>