size limit for TMPFS

Howard Su howard0su at gmail.com
Thu May 17 09:36:10 UTC 2007


In current implementation of tmpfs, the size limit of a tmpfs (which
is passed when mounting) only count the file size. The memory used for
directories is not limit. This due to the fact that there is not easy
and fast way to track a uma_zone's memory usage.

there are several approach:
1. hack vm to support a hook when uma_zone allocate a new page. this
approach comes from Rohit Jalan. This also need some new API in uma(9)
uma_set_allocate_hook
uma_set_deallocate_hook


2. Add a new API to uma(9) to report its memory usage. This will
require traveling a link list inside uma_zone.
uma_get_paged

3. Guess a file number limit based on size if use doesn't specific
explict, or get the number user sepcified. Use the number limit
instead of size limit to limit the memory usage. This doesn't need any
changes to uma. Also the implementation is clean.

I personally perfer way 3. Any suggestions?

-- 
-Howard


More information about the freebsd-fs mailing list