Skip to content

Commit 911a0cb

Browse files
committed
tunables: remove legacy FreeBSD aliases
These are old pre-OpenZFS tunable names that have long been available via either conventional ZFS_MODULE_PARAM tunables or through kstats. There's no point doubling up anymore, so delete them. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
1 parent 9d76950 commit 911a0cb

File tree

7 files changed

+27
-271
lines changed

7 files changed

+27
-271
lines changed

module/os/freebsd/zfs/sysctl_os.c

Lines changed: 0 additions & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ param_set_arc_max(SYSCTL_HANDLER_ARGS)
188188
return (0);
189189
}
190190

191-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_max,
192-
CTLTYPE_ULONG | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
193-
NULL, 0, param_set_arc_max, "LU",
194-
"Maximum ARC size in bytes (LEGACY)");
195-
196191
int
197192
param_set_arc_min(SYSCTL_HANDLER_ARGS)
198193
{
@@ -217,11 +212,6 @@ param_set_arc_min(SYSCTL_HANDLER_ARGS)
217212
return (0);
218213
}
219214

220-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_min,
221-
CTLTYPE_ULONG | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
222-
NULL, 0, param_set_arc_min, "LU",
223-
"Minimum ARC size in bytes (LEGACY)");
224-
225215
extern uint_t zfs_arc_free_target;
226216

227217
int
@@ -245,16 +235,6 @@ param_set_arc_free_target(SYSCTL_HANDLER_ARGS)
245235
return (0);
246236
}
247237

248-
/*
249-
* NOTE: This sysctl is CTLFLAG_RW not CTLFLAG_RWTUN due to its dependency on
250-
* pagedaemon initialization.
251-
*/
252-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_free_target,
253-
CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE,
254-
NULL, 0, param_set_arc_free_target, "IU",
255-
"Desired number of free pages below which ARC triggers reclaim"
256-
" (LEGACY)");
257-
258238
int
259239
param_set_arc_no_grow_shift(SYSCTL_HANDLER_ARGS)
260240
{
@@ -273,187 +253,6 @@ param_set_arc_no_grow_shift(SYSCTL_HANDLER_ARGS)
273253
return (0);
274254
}
275255

276-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_no_grow_shift,
277-
CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
278-
NULL, 0, param_set_arc_no_grow_shift, "I",
279-
"log2(fraction of ARC which must be free to allow growing) (LEGACY)");
280-
281-
extern uint64_t l2arc_write_max;
282-
283-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_write_max,
284-
CTLFLAG_RWTUN, &l2arc_write_max, 0,
285-
"Max write bytes per interval (LEGACY)");
286-
287-
extern uint64_t l2arc_write_boost;
288-
289-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_write_boost,
290-
CTLFLAG_RWTUN, &l2arc_write_boost, 0,
291-
"Extra write bytes during device warmup (LEGACY)");
292-
293-
extern uint64_t l2arc_headroom;
294-
295-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_headroom,
296-
CTLFLAG_RWTUN, &l2arc_headroom, 0,
297-
"Number of max device writes to precache (LEGACY)");
298-
299-
extern uint64_t l2arc_headroom_boost;
300-
301-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_headroom_boost,
302-
CTLFLAG_RWTUN, &l2arc_headroom_boost, 0,
303-
"Compressed l2arc_headroom multiplier (LEGACY)");
304-
305-
extern uint64_t l2arc_feed_secs;
306-
307-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_feed_secs,
308-
CTLFLAG_RWTUN, &l2arc_feed_secs, 0,
309-
"Seconds between L2ARC writing (LEGACY)");
310-
311-
extern uint64_t l2arc_feed_min_ms;
312-
313-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_feed_min_ms,
314-
CTLFLAG_RWTUN, &l2arc_feed_min_ms, 0,
315-
"Min feed interval in milliseconds (LEGACY)");
316-
317-
extern int l2arc_noprefetch;
318-
319-
SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_noprefetch,
320-
CTLFLAG_RWTUN, &l2arc_noprefetch, 0,
321-
"Skip caching prefetched buffers (LEGACY)");
322-
323-
extern int l2arc_feed_again;
324-
325-
SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_feed_again,
326-
CTLFLAG_RWTUN, &l2arc_feed_again, 0,
327-
"Turbo L2ARC warmup (LEGACY)");
328-
329-
extern int l2arc_norw;
330-
331-
SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_norw,
332-
CTLFLAG_RWTUN, &l2arc_norw, 0,
333-
"No reads during writes (LEGACY)");
334-
335-
static int
336-
param_get_arc_state_size(SYSCTL_HANDLER_ARGS)
337-
{
338-
arc_state_t *state = (arc_state_t *)arg1;
339-
int64_t val;
340-
341-
val = zfs_refcount_count(&state->arcs_size[ARC_BUFC_DATA]) +
342-
zfs_refcount_count(&state->arcs_size[ARC_BUFC_METADATA]);
343-
return (sysctl_handle_64(oidp, &val, 0, req));
344-
}
345-
346-
extern arc_state_t ARC_anon;
347-
348-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, anon_size,
349-
CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
350-
&ARC_anon, 0, param_get_arc_state_size, "Q",
351-
"size of anonymous state");
352-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_metadata_esize, CTLFLAG_RD,
353-
&ARC_anon.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
354-
"size of evictable metadata in anonymous state");
355-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_data_esize, CTLFLAG_RD,
356-
&ARC_anon.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
357-
"size of evictable data in anonymous state");
358-
359-
extern arc_state_t ARC_mru;
360-
361-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, mru_size,
362-
CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
363-
&ARC_mru, 0, param_get_arc_state_size, "Q",
364-
"size of mru state");
365-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_metadata_esize, CTLFLAG_RD,
366-
&ARC_mru.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
367-
"size of evictable metadata in mru state");
368-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_data_esize, CTLFLAG_RD,
369-
&ARC_mru.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
370-
"size of evictable data in mru state");
371-
372-
extern arc_state_t ARC_mru_ghost;
373-
374-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, mru_ghost_size,
375-
CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
376-
&ARC_mru_ghost, 0, param_get_arc_state_size, "Q",
377-
"size of mru ghost state");
378-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_metadata_esize, CTLFLAG_RD,
379-
&ARC_mru_ghost.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
380-
"size of evictable metadata in mru ghost state");
381-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_data_esize, CTLFLAG_RD,
382-
&ARC_mru_ghost.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
383-
"size of evictable data in mru ghost state");
384-
385-
extern arc_state_t ARC_mfu;
386-
387-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, mfu_size,
388-
CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
389-
&ARC_mfu, 0, param_get_arc_state_size, "Q",
390-
"size of mfu state");
391-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_metadata_esize, CTLFLAG_RD,
392-
&ARC_mfu.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
393-
"size of evictable metadata in mfu state");
394-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_data_esize, CTLFLAG_RD,
395-
&ARC_mfu.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
396-
"size of evictable data in mfu state");
397-
398-
extern arc_state_t ARC_mfu_ghost;
399-
400-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, mfu_ghost_size,
401-
CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
402-
&ARC_mfu_ghost, 0, param_get_arc_state_size, "Q",
403-
"size of mfu ghost state");
404-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_metadata_esize, CTLFLAG_RD,
405-
&ARC_mfu_ghost.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
406-
"size of evictable metadata in mfu ghost state");
407-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_data_esize, CTLFLAG_RD,
408-
&ARC_mfu_ghost.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
409-
"size of evictable data in mfu ghost state");
410-
411-
extern arc_state_t ARC_uncached;
412-
413-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, uncached_size,
414-
CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
415-
&ARC_uncached, 0, param_get_arc_state_size, "Q",
416-
"size of uncached state");
417-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, uncached_metadata_esize, CTLFLAG_RD,
418-
&ARC_uncached.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
419-
"size of evictable metadata in uncached state");
420-
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, uncached_data_esize, CTLFLAG_RD,
421-
&ARC_uncached.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
422-
"size of evictable data in uncached state");
423-
424-
extern arc_state_t ARC_l2c_only;
425-
426-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, l2c_only_size,
427-
CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
428-
&ARC_l2c_only, 0, param_get_arc_state_size, "Q",
429-
"size of l2c_only state");
430-
431-
/* dbuf.c */
432-
433-
/* dmu.c */
434-
435-
/* dmu_zfetch.c */
436-
437-
SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH (LEGACY)");
438-
439-
extern uint32_t zfetch_max_distance;
440-
441-
SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_distance,
442-
CTLFLAG_RWTUN, &zfetch_max_distance, 0,
443-
"Max bytes to prefetch per stream (LEGACY)");
444-
445-
extern uint32_t zfetch_max_idistance;
446-
447-
SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_idistance,
448-
CTLFLAG_RWTUN, &zfetch_max_idistance, 0,
449-
"Max bytes to prefetch indirects for per stream (LEGACY)");
450-
451-
/* dsl_pool.c */
452-
453-
/* dnode.c */
454-
455-
/* dsl_scan.c */
456-
457256
/* metaslab.c */
458257

459258
int
@@ -514,19 +313,6 @@ SYSCTL_UINT(_vfs_zfs, OID_AUTO, condense_pct,
514313
"Condense on-disk spacemap when it is more than this many percents"
515314
" of in-memory counterpart");
516315

517-
extern uint_t zfs_remove_max_segment;
518-
519-
SYSCTL_UINT(_vfs_zfs, OID_AUTO, remove_max_segment,
520-
CTLFLAG_RWTUN, &zfs_remove_max_segment, 0,
521-
"Largest contiguous segment ZFS will attempt to allocate when removing"
522-
" a device");
523-
524-
extern int zfs_removal_suspend_progress;
525-
526-
SYSCTL_INT(_vfs_zfs, OID_AUTO, removal_suspend_progress,
527-
CTLFLAG_RWTUN, &zfs_removal_suspend_progress, 0,
528-
"Ensures certain actions can happen while in the middle of a removal");
529-
530316
/*
531317
* Minimum size which forces the dynamic allocator to change
532318
* it's allocation strategy. Once the space map cannot satisfy
@@ -749,12 +535,6 @@ param_set_min_auto_ashift(SYSCTL_HANDLER_ARGS)
749535
return (0);
750536
}
751537

752-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, min_auto_ashift,
753-
CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
754-
&zfs_vdev_min_auto_ashift, sizeof (zfs_vdev_min_auto_ashift),
755-
param_set_min_auto_ashift, "IU",
756-
"Min ashift used when creating new top-level vdev. (LEGACY)");
757-
758538
int
759539
param_set_max_auto_ashift(SYSCTL_HANDLER_ARGS)
760540
{
@@ -774,13 +554,6 @@ param_set_max_auto_ashift(SYSCTL_HANDLER_ARGS)
774554
return (0);
775555
}
776556

777-
SYSCTL_PROC(_vfs_zfs, OID_AUTO, max_auto_ashift,
778-
CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
779-
&zfs_vdev_max_auto_ashift, sizeof (zfs_vdev_max_auto_ashift),
780-
param_set_max_auto_ashift, "IU",
781-
"Max ashift used when optimizing for logical -> physical sector size on"
782-
" new top-level vdevs. (LEGACY)");
783-
784557
/*
785558
* Since the DTL space map of a vdev is not expected to have a lot of
786559
* entries, we default its block size to 4K.
@@ -802,23 +575,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, standard_sm_blksz,
802575
CTLFLAG_RDTUN, &zfs_vdev_standard_sm_blksz, 0,
803576
"Block size for standard space map. Power of 2 greater than 4096.");
804577

805-
extern int vdev_validate_skip;
806-
807-
SYSCTL_INT(_vfs_zfs, OID_AUTO, validate_skip,
808-
CTLFLAG_RDTUN, &vdev_validate_skip, 0,
809-
"Enable to bypass vdev_validate().");
810-
811-
/* vdev_mirror.c */
812-
813-
/* vdev_queue.c */
814-
815-
extern uint_t zfs_vdev_max_active;
816-
817-
SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight,
818-
CTLFLAG_RWTUN, &zfs_vdev_max_active, 0,
819-
"The maximum number of I/Os of all types active for each device."
820-
" (LEGACY)");
821-
822578
/* zio.c */
823579

824580
SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, exclude_metadata,

module/zfs/arc.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,13 @@ static taskq_t *arc_flush_taskq;
486486
static uint_t zfs_arc_evict_threads = 0;
487487

488488
/* The 7 states: */
489-
arc_state_t ARC_anon;
490-
arc_state_t ARC_mru;
491-
arc_state_t ARC_mru_ghost;
492-
arc_state_t ARC_mfu;
493-
arc_state_t ARC_mfu_ghost;
494-
arc_state_t ARC_l2c_only;
495-
arc_state_t ARC_uncached;
489+
static arc_state_t ARC_anon;
490+
/* */ arc_state_t ARC_mru;
491+
static arc_state_t ARC_mru_ghost;
492+
/* */ arc_state_t ARC_mfu;
493+
static arc_state_t ARC_mfu_ghost;
494+
static arc_state_t ARC_l2c_only;
495+
static arc_state_t ARC_uncached;
496496

497497
arc_stats_t arc_stats = {
498498
{ "hits", KSTAT_DATA_UINT64 },
@@ -832,15 +832,15 @@ typedef struct arc_async_flush {
832832
#define L2ARC_FEED_TYPES 4
833833

834834
/* L2ARC Performance Tunables */
835-
uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* def max write size */
836-
uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra warmup write */
837-
uint64_t l2arc_headroom = L2ARC_HEADROOM; /* # of dev writes */
838-
uint64_t l2arc_headroom_boost = L2ARC_HEADROOM_BOOST;
839-
uint64_t l2arc_feed_secs = L2ARC_FEED_SECS; /* interval seconds */
840-
uint64_t l2arc_feed_min_ms = L2ARC_FEED_MIN_MS; /* min interval msecs */
841-
int l2arc_noprefetch = B_TRUE; /* don't cache prefetch bufs */
842-
int l2arc_feed_again = B_TRUE; /* turbo warmup */
843-
int l2arc_norw = B_FALSE; /* no reads during writes */
835+
static uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* def max write size */
836+
static uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra warmup write */
837+
static uint64_t l2arc_headroom = L2ARC_HEADROOM; /* # of dev writes */
838+
static uint64_t l2arc_headroom_boost = L2ARC_HEADROOM_BOOST;
839+
static uint64_t l2arc_feed_secs = L2ARC_FEED_SECS; /* interval seconds */
840+
static uint64_t l2arc_feed_min_ms = L2ARC_FEED_MIN_MS; /* min interval msecs */
841+
static int l2arc_noprefetch = B_TRUE; /* don't cache prefetch bufs */
842+
static int l2arc_feed_again = B_TRUE; /* turbo warmup */
843+
static int l2arc_norw = B_FALSE; /* no reads during writes */
844844
static uint_t l2arc_meta_percent = 33; /* limit on headers size */
845845

846846
/*

module/zfs/dmu_zfetch.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ static unsigned int zfetch_max_sec_reap = 2;
5757
/* min bytes to prefetch per stream (default 2MB) */
5858
static unsigned int zfetch_min_distance = 2 * 1024 * 1024;
5959
/* max bytes to prefetch per stream (default 8MB) */
60-
unsigned int zfetch_max_distance = 8 * 1024 * 1024;
60+
static unsigned int zfetch_max_distance = 8 * 1024 * 1024;
6161
#else
6262
/* min bytes to prefetch per stream (default 4MB) */
6363
static unsigned int zfetch_min_distance = 4 * 1024 * 1024;
6464
/* max bytes to prefetch per stream (default 64MB) */
65-
unsigned int zfetch_max_distance = 64 * 1024 * 1024;
65+
static unsigned int zfetch_max_distance = 64 * 1024 * 1024;
6666
#endif
6767
/* max bytes to prefetch indirects for per stream (default 128MB) */
68-
unsigned int zfetch_max_idistance = 128 * 1024 * 1024;
68+
static unsigned int zfetch_max_idistance = 128 * 1024 * 1024;
6969
/* max request reorder distance within a stream (default 16MB) */
70-
unsigned int zfetch_max_reorder = 16 * 1024 * 1024;
70+
static unsigned int zfetch_max_reorder = 16 * 1024 * 1024;
7171
/* Max log2 fraction of holes in a stream */
72-
unsigned int zfetch_hole_shift = 2;
72+
static unsigned int zfetch_hole_shift = 2;
7373

7474
typedef struct zfetch_stats {
7575
kstat_named_t zfetchstat_hits;

module/zfs/vdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static uint_t zfs_vdev_default_ms_shift = 29;
100100
/* upper limit for metaslab size (16G) */
101101
static uint_t zfs_vdev_max_ms_shift = 34;
102102

103-
int vdev_validate_skip = B_FALSE;
103+
static int vdev_validate_skip = B_FALSE;
104104

105105
/*
106106
* Since the DTL space map of a vdev is not expected to have a lot of

module/zfs/vdev_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
* The maximum number of i/os active to each device. Ideally, this will be >=
123123
* the sum of each queue's max_active.
124124
*/
125-
uint_t zfs_vdev_max_active = 1000;
125+
static uint_t zfs_vdev_max_active = 1000;
126126

127127
/*
128128
* Per-queue limits on the number of i/os active to each device. If the

0 commit comments

Comments
 (0)