aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/os/freebsd/spl/sys/mod_os.h6
-rw-r--r--include/sys/arc.h7
-rw-r--r--include/sys/arc_impl.h2
3 files changed, 15 insertions, 0 deletions
diff --git a/include/os/freebsd/spl/sys/mod_os.h b/include/os/freebsd/spl/sys/mod_os.h
index 5b3b3271e..5695abee7 100644
--- a/include/os/freebsd/spl/sys/mod_os.h
+++ b/include/os/freebsd/spl/sys/mod_os.h
@@ -62,6 +62,12 @@
#define param_set_arc_long_args(var) \
CTLTYPE_ULONG, &var, 0, param_set_arc_long, "LU"
+#define param_set_arc_min_args(var) \
+ CTLTYPE_ULONG, &var, 0, param_set_arc_min, "LU"
+
+#define param_set_arc_max_args(var) \
+ CTLTYPE_ULONG, &var, 0, param_set_arc_max, "LU"
+
#define param_set_arc_int_args(var) \
CTLTYPE_INT, &var, 0, param_set_arc_int, "I"
diff --git a/include/sys/arc.h b/include/sys/arc.h
index 20fa47bd9..afbe65bb1 100644
--- a/include/sys/arc.h
+++ b/include/sys/arc.h
@@ -46,6 +46,13 @@ extern "C" {
*/
#define ARC_EVICT_ALL UINT64_MAX
+/*
+ * ZFS gets very unhappy when the maximum ARC size is smaller than the maximum
+ * block size and a larger block is written. To leave some safety margin, we
+ * limit the minimum for zfs_arc_max to the maximium transaction size.
+ */
+#define MIN_ARC_MAX DMU_MAX_ACCESS
+
#define HDR_SET_LSIZE(hdr, x) do { \
ASSERT(IS_P2ALIGNED(x, 1U << SPA_MINBLOCKSHIFT)); \
(hdr)->b_lsize = ((x) >> SPA_MINBLOCKSHIFT); \
diff --git a/include/sys/arc_impl.h b/include/sys/arc_impl.h
index f99d2911b..89be78ce2 100644
--- a/include/sys/arc_impl.h
+++ b/include/sys/arc_impl.h
@@ -1004,6 +1004,8 @@ extern void arc_unregister_hotplug(void);
extern int param_set_arc_long(ZFS_MODULE_PARAM_ARGS);
extern int param_set_arc_int(ZFS_MODULE_PARAM_ARGS);
+extern int param_set_arc_min(ZFS_MODULE_PARAM_ARGS);
+extern int param_set_arc_max(ZFS_MODULE_PARAM_ARGS);
/* used in zdb.c */
boolean_t l2arc_log_blkptr_valid(l2arc_dev_t *dev,