From owner-freebsd-current@FreeBSD.ORG Mon Apr 2 10:59:34 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99567106564A for ; Mon, 2 Apr 2012 10:59:34 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (m209-73.dsl.rawbw.com [198.144.209.73]) by mx1.freebsd.org (Postfix) with ESMTP id 50D1A8FC15 for ; Mon, 2 Apr 2012 10:59:34 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.5/8.14.5) with ESMTP id q32AxXeg007691; Mon, 2 Apr 2012 03:59:33 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.5/8.14.5/Submit) id q32AxXno007690; Mon, 2 Apr 2012 03:59:33 -0700 (PDT) (envelope-from david) Date: Mon, 2 Apr 2012 03:59:33 -0700 From: David Wolfskill To: Gleb Kurtsou Message-ID: <20120402105933.GC1420@albert.catwhisker.org> References: <4F746F1E.6090702@mail.zedat.fu-berlin.de> <20120329161452.GZ1709@albert.catwhisker.org> <4F74BCD5.4040609@zedat.fu-berlin.de> <20120402103119.GA2389@reks> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xo44VMWPx7vlQ2+2" Content-Disposition: inline In-Reply-To: <20120402103119.GA2389@reks> User-Agent: Mutt/1.4.2.3i Cc: Current FreeBSD Subject: Re: Using TMPFS for /tmp and /var/run? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2012 10:59:34 -0000 --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--