[Bug 223015] [tmpfs] tmpfs does not support sparse files

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Oct 15 11:41:15 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223015

Konstantin Belousov <kib at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kib at FreeBSD.org

--- Comment #1 from Konstantin Belousov <kib at FreeBSD.org> ---
Well, tmpfs does support spare files.

What you reported is indeed the wrong behavior, but it is caused not by
supposed lack of support for spares, but due to wrong code what tries to avoid
OOM situations due to over-committing the file backing for tmpfs files.  See
sys/fs/tmpfs_subr.c, functions tmpfs_pages_check_avail() and functions
tmpfs_mem_avail() and tmpfs_pages_used() referenced from there.

In particular, tmpfs_mem_avail() is completely wrong, it mis-interprets
v_free_count.

I think that tmpfs should only check the current page usage by specific mount
point against per-mount point limit, if any.  Trying to formulate a limit
against some formula involving v_free_count and other VM metrics cannot work,
due to the VM algorithms.  The main reason is that we support paging memory to
the backing store, so v_free_count indicates wasted memory (as opposed to the
free or free-able memory in the common sense of the word).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-fs mailing list