tmpfs is zero bytes (no free space), maybe a zfs bug?

Kostik Belousov kostikbel at
Wed Jan 19 15:02:05 UTC 2011

On Wed, Jan 19, 2011 at 11:39:41AM +0100, Ivan Voras wrote:
> On 19/01/2011 11:09, Attila Nagy wrote:
> >On 01/19/11 09:46, Jeremy Chadwick wrote:
> >>On Wed, Jan 19, 2011 at 09:37:35AM +0100, Attila Nagy wrote:
> >>>I first noticed this problem on machines with more memory (32GB
> >>>eg.), but now it happens on 4G machines too:
> >>>tmpfs 0B 0B 0B
> >>>100% /tmp
> >>>FreeBSD builder 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Sat Jan 8
> >>>22:11:54 CET 2011
> >>>
> >>>Maybe it's related, that I use zfs on these machines...
> >>>
> >>>Sometimes it grows and shrinks, but generally there is no space even
> >>>for a small file, or a socket to create.
> >>
> >>
> >>
> >Oh crap. :(
> >
> >I hope somebody can find the time to look into this, it's pretty
> >annoying...
> I don't think this is a complete solution but it's a start. If you can, 
> try it and see if it helps.
This is not a start, and actually a step in the wrong direction.
Tmpfs is wrong now, but the patch would make the wrongness even bigger.

Issue is that the current tmpfs calculation should not depend on the
length of the inactive queue or the amount of free pages. This data only
measures  the pressure on the pagedaemon, and has absolutely no relation
to the amount of data that can be put into anonymous objects before the
system comes out of swap.

vm_lowmem handler is invoked in two situations:
- when KVA cannot satisfy the request for the space allocation;
- when pagedaemon have to start the scan.
None of the situations has any direct correlation with the fact that
tmpfs needs to check, that is "Is there enough swap to keep all my
future anonymous memory requests ?".

Might be, swap reservation numbers can be useful to the tmpfs reporting.
Also might be, tmpfs should reserve the swap explicitely on start, instead
of making attempts to guess how much can be allocated at random moment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-stable mailing list