Date: Thu, 17 May 2007 06:33:59 -0500 From: Eric Anderson <anderson@freebsd.org> To: Howard Su <howard0su@gmail.com> Cc: fs@freebsd.org Subject: Re: size limit for TMPFS Message-ID: <464C3DA7.3020003@freebsd.org> In-Reply-To: <f126fae00705170236t687a92des3f42415fd06d75b9@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
On 05/17/07 04:36, Howard Su wrote: > 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? > Track the memory usage on your own? As you allocate, keep a counter and total up the usage outside of uma. (3) sounds good, except it may not be accurate, and that could lead to confusion for someone. Erichome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?464C3DA7.3020003>
