is TMPFS still highly experimental?

Gleb Kurtsou gleb.kurtsou at gmail.com
Wed Oct 5 09:55:27 UTC 2011


On (04/10/2011 16:19), Olivier Smedts wrote:
> 2011/10/4 Xin LI <delphij at gmail.com>:
> > On Mon, Oct 3, 2011 at 2:36 PM, Olivier Smedts <olivier at gid0.org> wrote:
> > [...]
> >> Try reducing the swap size to less than the RAM size. No "configuration
> >> issue", try with some RAM + swap that should fit all.
> >
> > But it's not ZFS+tmpfs specific, it can happen anywhere when memory
> > and swap is not sufficient.  Of course tmpfs and ZFS should play more
> > well together but it's pretty much a "you get what you paid for"
> > situation IMHO.
> 
> But there's a problem in this configuration and when memory and swap
> are sufficient (swap free, some RAM free). tmpfs size drops to 0
> because it does not seem to calculate the free size correctly. If
> there is sufficient RAM (some RAM free), sufficient swap (all free)
> but less swap than RAM, and wired memory usage is high (ZFS ARC),
> tmpfs size drops to 0.

Free RAM is a bit tricky with virtual memory and overcommit support all
over the place. There are at least 3 memory hungry subsystems: buffer
cache, ZFS ARC, tmpfs.

For the first two there is defined maximum size and they can be shrunk
in low memory situations. Tmpfs grows as much as it can trying to
calculate "free" memory available. Another difference is that tmpfs
can't be shrunk in low memory situation.

I proposed a patch changing tmpfs memory allocation:
- Define maximum file system size (RAM/2 by default)
- Don't try to check if free memory available, check free swap
  instead and allocate more aggressively, i.e. allocate until
  swap or file system limit is reached.

Patch:
http://marc.info/?l=freebsd-fs&m=129747367322954&w=2
https://github.com/glk/freebsd-head/tree/tmpfs

Thanks,
Gleb.

> > One thing I can not yet reproduce, but sounds like a serious issue is
> > that when system have sufficient RAM available, ZFS reports 0 in free
> > space...  If there is a test case for that then that's definitely
> > something we need to solve sooner.
> >
> > Cheers,
> > --
> > Xin LI <delphij at delphij.net> https://www.delphij.net/
> > FreeBSD - The Power to Serve! Live free or die
> >
> 
> -- 
> Olivier Smedts                                                 _
>                                         ASCII ribbon campaign ( )
> e-mail: olivier at gid0.org        - against HTML email & vCards  X
> www: http://www.gid0.org    - against proprietary attachments / \
> 
>   "Il y a seulement 10 sortes de gens dans le monde :
>   ceux qui comprennent le binaire,
>   et ceux qui ne le comprennent pas."
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"


More information about the freebsd-fs mailing list