Minimum memory for ZFS (was Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts)

Peter Jeremy peter at rulingia.com
Tue Jan 28 06:42:29 UTC 2020


On 2020-Jan-26 10:58:15 -1000, Jeff Roberson <jroberson at jroberson.net> wrote:
>My proposal is this, limit ARC to some reasonable fraction of memory, say 
>1/8th, and then do the following:
>
>On expiration from arc place the pages in a vm object associated with the 
>device.  The VM is now free to keep them or re-use them for user memory.
>
>On miss from arc check the page cache and take the pages back if they 
>exist.
>
>On invalidation you need to invalidate the page cache.

ZFS already has a mechanism for the VM system to request that ARC be
shrunk.  This was designed around the Solaris VM system and isn't a perfect
match with the FreeBSD VM system.  There has been a lot of work, within
FreeBSD, over the years to improve the way this behaves but it's obviously
not perfect.  One point of confusion is that FreeBSD and Solaris use
identical terms to mean different things within their VM systems.

>ARC already allows spilling to SSD.  I don't know the particulars of the 
>interface but we're essentially spilling to memory that can be reclaimed 
>by the page daemon as necessary.

This is L2ARC.  ZFS expects that L2ARC refers to a fixed amount of space
that ZFS has control over.  I'm unaware of any mechanism for an external
system to reclaim L2ARC space - it would require the external system to
request ZFS (via an, AFAIK, non-existent interface) to free L2ARC objects.

ZFS only implements a single level of L2ARC so re-using L2ARC for this new
caching mechanism would also prevent the use of traditional SSD-based L2ARC
on FreeBSD.

Since ZFS already has a mechanism for an external system to request that
ZFS release memory, I believe effort would be better expended in getting
FreeBSD to better exchange memory pressure data with ZFS via that existing
mechanism, rather than inventing a new mechanism that is intended to
achieve much the same result, whilst effectively removing a ZFS feature.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20200128/affec0a4/attachment.sig>


More information about the freebsd-arch mailing list