Martin Husemann <mar...@duskware.de> wrote: > <...> > > See mount_tmpfs(8), in the paragraph about the -s option: > > Note that four megabytes are always reserved for the system and cannot > be assigned to the file system. >
This wording may be confusing. tmpfs does not reserve the memory in a sense of allocation. It imposes a hard limit and, in addition, it checks that there is at least 4MB left for the system (if not, it considers that as hitting the limit and fails to allocate more memory). Note that the current mechanism of using the "floating" number of free memory is wrong. It is not reliable and should not really be done that way. The UVM itself has some reserved memory so that it could function if the memory is exhausted (see reserve_pagedaemon and reserve_kernel in uvmexp). I think that the assumptions about minimum memory requirements should be made by UVM and if we want to keep a helper mechanism in tmpfs, then I agree with Eduardo that it should rather be using uvmexp.freemin target. -- Mindaugas