summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorGeorge Amanakis <[email protected]>2021-11-11 21:52:16 +0100
committerTony Hutter <[email protected]>2022-09-14 11:27:00 -0700
commit8bd3dca9bf3e9a4315d58be316bcfaf8e76c6a6a (patch)
tree71709914cb18a70dd9c5744290c05aa089b36576 /include/sys
parentc8f795ba53acfe0239bfa5d75f64dce8e390a992 (diff)
Introduce a tunable to exclude special class buffers from L2ARC
Special allocation class or dedup vdevs may have roughly the same performance as L2ARC vdevs. Introduce a new tunable to exclude those buffers from being cacheable on L2ARC. Reviewed-by: Don Brady <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #11761 Closes #12285
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/arc.h1
-rw-r--r--include/sys/dbuf.h11
-rw-r--r--include/sys/dmu_objset.h4
3 files changed, 2 insertions, 14 deletions
diff --git a/include/sys/arc.h b/include/sys/arc.h
index a3241f368..5d8176894 100644
--- a/include/sys/arc.h
+++ b/include/sys/arc.h
@@ -85,6 +85,7 @@ typedef void arc_prune_func_t(int64_t bytes, void *priv);
/* Shared module parameters */
extern int zfs_arc_average_blocksize;
+extern int l2arc_exclude_special;
/* generic arc_done_func_t's which you can use */
arc_read_done_func_t arc_bcopy_func;
diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h
index 93d80066b..2e7385113 100644
--- a/include/sys/dbuf.h
+++ b/include/sys/dbuf.h
@@ -441,16 +441,7 @@ dbuf_find_dirty_eq(dmu_buf_impl_t *db, uint64_t txg)
(dbuf_is_metadata(_db) && \
((_db)->db_objset->os_primary_cache == ZFS_CACHE_METADATA)))
-#define DBUF_IS_L2CACHEABLE(_db) \
- ((_db)->db_objset->os_secondary_cache == ZFS_CACHE_ALL || \
- (dbuf_is_metadata(_db) && \
- ((_db)->db_objset->os_secondary_cache == ZFS_CACHE_METADATA)))
-
-#define DNODE_LEVEL_IS_L2CACHEABLE(_dn, _level) \
- ((_dn)->dn_objset->os_secondary_cache == ZFS_CACHE_ALL || \
- (((_level) > 0 || \
- DMU_OT_IS_METADATA((_dn)->dn_handle->dnh_dnode->dn_type)) && \
- ((_dn)->dn_objset->os_secondary_cache == ZFS_CACHE_METADATA)))
+boolean_t dbuf_is_l2cacheable(dmu_buf_impl_t *db);
#ifdef ZFS_DEBUG
diff --git a/include/sys/dmu_objset.h b/include/sys/dmu_objset.h
index e89ee64ea..7ade2dc91 100644
--- a/include/sys/dmu_objset.h
+++ b/include/sys/dmu_objset.h
@@ -200,10 +200,6 @@ struct objset {
#define DMU_GROUPUSED_DNODE(os) ((os)->os_groupused_dnode.dnh_dnode)
#define DMU_PROJECTUSED_DNODE(os) ((os)->os_projectused_dnode.dnh_dnode)
-#define DMU_OS_IS_L2CACHEABLE(os) \
- ((os)->os_secondary_cache == ZFS_CACHE_ALL || \
- (os)->os_secondary_cache == ZFS_CACHE_METADATA)
-
/* called from zpl */
int dmu_objset_hold(const char *name, void *tag, objset_t **osp);
int dmu_objset_hold_flags(const char *name, boolean_t decrypt, void *tag,