tmpfs use of wired_count

From: Jeseem S <jeseems_at_gmail.com>
Date: Wed, 30 Jun 2010 09:33:29 -0700
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 ?


/*
 * 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
Received on Wed Jun 30 2010 - 15:03:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:05 UTC