4. Technical Description A. SUMMARY This case adds two new dataset-level properties, 'primarycache' and 'secondarycache', to the existing zfs property infrastructure. These properties control what is cached in the primary cache (ARC) and the secondary cache (l2ARC). B. USE CASES One use case for not caching reads of user data is a large buffer cache (part of the SGA) for Oracle. If the admin wants to cache at the database level, then it's pointless and wasteful to attempt to cache the same data at the file system level as well. One use case for not caching writes of user data is the log writer for Oracle. This data is only needed to redo transactions in the case of a panic / unplanned shutdown. We've also had users on zfs-discuss ask for the ability to control what is cached. Two such examples are noted here: http://www.opensolaris.org/jive/thread.jspa?threadID=52159&tstart=0 http://www.opensolaris.org/jive/thread.jspa?messageID=202791𱠧 One reason we need to separate the control of the primary cache from the secondary cache is to allow customers the ability to charge for use of the l2ARC. C. PROPOSED SOLUTION The introduction of the 'primarycache' property will allow administrators the ability to control what is cached in the ARC. The possible choices are: all, none, and metadata. If 'all' is chosen, then both user data and metadata are cached. If 'none' is chosen, then neither user data nor metadata is cached. If 'metadata' is chosen, then only metadata is cached. The default is 'all'. The introduction of the 'secondarycache' property will allow administrators the ability to control what is cached in the l2ARC. The possible choices are the exact same as 'primarycache'. The default is also 'all'. The syntax for setting these zfs properties is as follows: # zfs set primarycache=metadata # zfs create -o primarycache=metadata # zfs set secondarycache=none # zfs create -o secondarycache=none D. MANPAGE DIFFS The following text will be added under the "Properties" section in zfs(1M): primarycache=all | none | metadata Controls what is cached in the primary cache (ARC). If set to "all", then both user data and metadata is cached. If set to "none", then neither user data nor metadata is cached. If set to "metadata", then only metadata is cached. The default behavior is "all". secondarycache=all | none | metadata Controls what is cached in the secondary cache (l2ARC). If set to "all", then both user data and metadata is cached. If set to "none", then neither user data nor metadata is cached. If set to "metadata", then only metadata is cached. The default behavior is "all". Also, 'primarycache' and 'secondarycache' will be listed under allowable permissions for 'zfs allow' in zfs(1M).