Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2007 17:36:09 +0800
From:      "Howard Su" <howard0su@gmail.com>
To:        fs@freebsd.org
Subject:   size limit for TMPFS
Message-ID:  <f126fae00705170236t687a92des3f42415fd06d75b9@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f126fae00705170236t687a92des3f42415fd06d75b9>