On Thu, Jun 25, 2009 at 11:16:50AM -0700, Sean Liu wrote:
> Now that ZFS cache will  eat up all the free mem for cache, again
> that's all fine. But vmstat doesn't report meaningful free memory
> again. Yes memstat can tell you the ZFS file data size but who wants
> to run mdb every now and then?
> 
> Can we introduce some new kernel variable the way we introduced
> cachelist and make vmstat free memory report meaningful again?

I disagree with the premise that the free memory calculation isn't
useful because it doesn't count ZFS caches as free space.  They aren't
free space.  The memory is in use by the system, and unless it's able to
reduce the size of the cache, that memory isn't going to be availble to
your application.  The ZFS caches are in kmem, and are maintained
differently than the freelist and cachelist, which are actually lists of
unused pages.  Pages in the ARC are mapped by segkmem and allocated
through the kmem cache; as far as the system is concerned, these pages
are in use.

Since kmem has to free all of the objects allocated from a slab before
it can return the space to vmem, heap fragmentation, and subsystems that
don't have reliable memory release callbacks can make it difficult for
kmem to reclaim unused space.  If you're on a ONNV kernel, get in mdb
-k, and run ::kmem_slabs to see how much space is wasted due to
fragmentation in a particular cache.

The space that's consumed by ZFS is in use and can't simply be peeled
off a free-list and used immediately.  Adding a variable that counts
space used by ZFS as free is actually going to be more confusing.

-j

_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to