Date: Thu, 1 Jul 2010 13:33:57 -0500 From: Alan Cox <alan.l.cox@gmail.com> To: Jeseem S <jeseems@gmail.com> Cc: freebsd-current@freebsd.org Subject: Re: tmpfs use of wired_count Message-ID: <AANLkTikVMsZ13BWI_yhQqdwI8ZNhMZWHb-w5mL50hk1Z@mail.gmail.com> In-Reply-To: <AANLkTimaRHB7ac8QbHdzE8t_Uekm34WwOx-aw14IK1AB@mail.gmail.com> References: <AANLkTimaRHB7ac8QbHdzE8t_Uekm34WwOx-aw14IK1AB@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 30, 2010 at 11:33 AM, Jeseem S <jeseems@gmail.com> wrote: > hi, > I am a newbie on freebsd kernel. Am currently trying to debug a scenario, > where a custom driver I load uses a lot of static memory and hence lots of > wired pages. > The system still has a lot of free memory ( more than 200MB) and a free > swap > space ( > 500MB). > Once I load the driver, the tmpfs loaded on /tmp shows a size of 0. > > in tmpfs/tmpfs.h, I see that the free memory available is reduced by number > of wired pages ( see code below). > Is this correct logic ? why do we need to reduce wired count from free > pages available ? > > No, it doesn't appear correct. Moreover, it's also incorrect that cnt.v_cache_count isn't included in the initial calculation of size. Regards, Alan > > /* > * Returns information about the number of available memory pages, > * including physical and virtual ones. > * > * If 'total' is TRUE, the value returned is the total amount of memory > * pages configured for the system (either in use or free). > * If it is FALSE, the value returned is the amount of free memory pages. > * > * Remember to remove TMPFS_PAGES_RESERVED from the returned value to avoid > * excessive memory usage. > * > */ > static __inline size_t > tmpfs_mem_info(void) > { > size_t size; > > size = swap_pager_avail + cnt.v_free_count + cnt.v_inactive_count; > size -= size > cnt.v_wire_count ? cnt.v_wire_count : size; > return size; > } > > > Thanks > Jeseem > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikVMsZ13BWI_yhQqdwI8ZNhMZWHb-w5mL50hk1Z>