zfsonfreebsd / ZoF

ZFS on FreeBSD - the official out of tree OpenZFS implementation for FreeBSD
https://freebsd.org
Other
100 stars 8 forks source link

Unexpected vfs.zfs.arc.min and max reporting #142

Closed michaeldexter closed 4 years ago

michaeldexter commented 4 years ago

System information

Type | Version/Name --- | openzfs-2019101600 --- Distribution Name | FreeBSD Distribution Version | 12.1-RELEASE-p1

Describe the problem you're observing

'sysctl vfs.zfs.arc.min' and max are not behaving as expected, reporting "0" rather than, presumably the current value.

Describe how to reproduce the problem

sysctl -a | grep vfs.zfs.arc.max: vfs.zfs.arc.max: 0 sysctl vfs.zfs.arc.max vfs.zfs.arc.max: 0 sysctl vfs.zfs.arc.max=16777216 vfs.zfs.arc.max: 0 -> 16777216 top -b | grep ARC ARC: 380M Total 40M MFU, ... (ARC is active suggesting it has a min and max set. Correct? Has the behavior changed?)

How does one obtain the current vfs.zfs.arc.min and vfs.zfs.arc.max values?

mattmacy commented 4 years ago
 sysctl vfs.zfs.arc
vfs.zfs.arc.dnode_reduce_percent: 10
vfs.zfs.arc.average_blocksize: 8192
vfs.zfs.arc.pc_percent: 0
vfs.zfs.arc.p_dampener_disable: 1
vfs.zfs.arc.meta_strategy: 1
vfs.zfs.arc.meta_adjust_restarts: 4096
vfs.zfs.arc.meta_prune: 10000
vfs.zfs.arc.meta_min: 0
vfs.zfs.arc.meta_limit_percent: 75
vfs.zfs.arc.meta_limit: 0
vfs.zfs.arc.max: 0
vfs.zfs.arc.min: 0
mattmacy commented 4 years ago

0 -> hasn't been set by user - which is a lot more logical than what FreeBSD does

I don't want to maintain distinct behaviors by default. However, I'm open to adding tunable proc zfs_legacy_defaults to turn on the hitherto default behavior.

michaeldexter commented 4 years ago

Understood!

Do any vfs.zfs.arc.* sysctls will provide the current ARC and L2ARC stats? I understand that the port I am using may be significantly out of sync with the development branch(es).

mattmacy commented 4 years ago
sysctl vfs.zfs | grep l2arc
vfs.zfs.l2arc_norw: 0
vfs.zfs.l2arc_feed_again: 1
vfs.zfs.l2arc_noprefetch: 1
vfs.zfs.l2arc_feed_min_ms: 200
vfs.zfs.l2arc_feed_secs: 1
vfs.zfs.l2arc_headroom: 2
vfs.zfs.l2arc_write_boost: 8388608
vfs.zfs.l2arc_write_max: 8388608
vfs.zfs.l2arc.norw: 0
vfs.zfs.l2arc.feed_again: 1
vfs.zfs.l2arc.noprefetch: 1
vfs.zfs.l2arc.feed_min_ms: 200
vfs.zfs.l2arc.feed_secs: 1
vfs.zfs.l2arc.headroom_boost: 200
vfs.zfs.l2arc.headroom: 2
vfs.zfs.l2arc.write_boost: 8388608
vfs.zfs.l2arc.write_max: 8388608
kstat.zfs.misc.arcstats.arc_raw_size: 0
kstat.zfs.misc.arcstats.arc_sys_free: 0
kstat.zfs.misc.arcstats.arc_need_free: 0
kstat.zfs.misc.arcstats.demand_hit_prescient_prefetch: 0
kstat.zfs.misc.arcstats.demand_hit_predictive_prefetch: 0
kstat.zfs.misc.arcstats.async_upgrade_sync: 0
kstat.zfs.misc.arcstats.arc_meta_min: 16777216
kstat.zfs.misc.arcstats.arc_meta_max: 0
kstat.zfs.misc.arcstats.arc_dnode_limit: 320786534
kstat.zfs.misc.arcstats.arc_meta_limit: 3207865344
kstat.zfs.misc.arcstats.arc_meta_used: 0
kstat.zfs.misc.arcstats.arc_prune: 0
kstat.zfs.misc.arcstats.arc_loaned_bytes: 0
kstat.zfs.misc.arcstats.arc_tempreserve: 0
kstat.zfs.misc.arcstats.arc_no_grow: 0
kstat.zfs.misc.arcstats.memory_available_bytes: 0
kstat.zfs.misc.arcstats.memory_free_bytes: 0
kstat.zfs.misc.arcstats.memory_all_bytes: 0
kstat.zfs.misc.arcstats.memory_indirect_count: 0
kstat.zfs.misc.arcstats.memory_direct_count: 0
kstat.zfs.misc.arcstats.memory_throttle_count: 0
kstat.zfs.misc.arcstats.l2_hdr_size: 0
kstat.zfs.misc.arcstats.l2_asize: 0
kstat.zfs.misc.arcstats.l2_size: 0
kstat.zfs.misc.arcstats.l2_io_error: 0
kstat.zfs.misc.arcstats.l2_cksum_bad: 0
kstat.zfs.misc.arcstats.l2_abort_lowmem: 0
kstat.zfs.misc.arcstats.l2_free_on_write: 0
kstat.zfs.misc.arcstats.l2_evict_l1cached: 0
kstat.zfs.misc.arcstats.l2_evict_reading: 0
kstat.zfs.misc.arcstats.l2_evict_lock_retry: 0
kstat.zfs.misc.arcstats.l2_writes_lock_retry: 0
kstat.zfs.misc.arcstats.l2_writes_error: 0
kstat.zfs.misc.arcstats.l2_writes_done: 0
kstat.zfs.misc.arcstats.l2_writes_sent: 0
kstat.zfs.misc.arcstats.l2_write_bytes: 0
kstat.zfs.misc.arcstats.l2_read_bytes: 0
kstat.zfs.misc.arcstats.l2_rw_clash: 0
kstat.zfs.misc.arcstats.l2_feeds: 0
kstat.zfs.misc.arcstats.l2_misses: 0
kstat.zfs.misc.arcstats.l2_hits: 0
kstat.zfs.misc.arcstats.mfu_ghost_evictable_metadata: 0
kstat.zfs.misc.arcstats.mfu_ghost_evictable_data: 0
kstat.zfs.misc.arcstats.mfu_ghost_size: 0
kstat.zfs.misc.arcstats.mfu_evictable_metadata: 0
kstat.zfs.misc.arcstats.mfu_evictable_data: 0
kstat.zfs.misc.arcstats.mfu_size: 0
kstat.zfs.misc.arcstats.mru_ghost_evictable_metadata: 0
kstat.zfs.misc.arcstats.mru_ghost_evictable_data: 0
kstat.zfs.misc.arcstats.mru_ghost_size: 0
kstat.zfs.misc.arcstats.mru_evictable_metadata: 0
kstat.zfs.misc.arcstats.mru_evictable_data: 0
kstat.zfs.misc.arcstats.mru_size: 0
kstat.zfs.misc.arcstats.anon_evictable_metadata: 0
kstat.zfs.misc.arcstats.anon_evictable_data: 0
kstat.zfs.misc.arcstats.anon_size: 0
kstat.zfs.misc.arcstats.bonus_size: 0
kstat.zfs.misc.arcstats.dnode_size: 0
kstat.zfs.misc.arcstats.dbuf_size: 0
kstat.zfs.misc.arcstats.metadata_size: 0
kstat.zfs.misc.arcstats.data_size: 0
kstat.zfs.misc.arcstats.hdr_size: 0
kstat.zfs.misc.arcstats.overhead_size: 0
kstat.zfs.misc.arcstats.uncompressed_size: 0
kstat.zfs.misc.arcstats.compressed_size: 0
kstat.zfs.misc.arcstats.size: 0
kstat.zfs.misc.arcstats.c_max: 4277153792
kstat.zfs.misc.arcstats.c_min: 267322112
kstat.zfs.misc.arcstats.c: 4277153792
kstat.zfs.misc.arcstats.p: 2138576896
kstat.zfs.misc.arcstats.hash_chain_max: 0
kstat.zfs.misc.arcstats.hash_chains: 0
kstat.zfs.misc.arcstats.hash_collisions: 0
kstat.zfs.misc.arcstats.hash_elements_max: 0
kstat.zfs.misc.arcstats.hash_elements: 0
kstat.zfs.misc.arcstats.evict_l2_skip: 0
kstat.zfs.misc.arcstats.evict_l2_ineligible: 0
kstat.zfs.misc.arcstats.evict_l2_eligible: 0
kstat.zfs.misc.arcstats.evict_l2_cached: 0
kstat.zfs.misc.arcstats.evict_not_enough: 0
kstat.zfs.misc.arcstats.evict_skip: 0
kstat.zfs.misc.arcstats.access_skip: 0
kstat.zfs.misc.arcstats.mutex_miss: 0
kstat.zfs.misc.arcstats.deleted: 0
kstat.zfs.misc.arcstats.mfu_ghost_hits: 0
kstat.zfs.misc.arcstats.mfu_hits: 0
kstat.zfs.misc.arcstats.mru_ghost_hits: 0
kstat.zfs.misc.arcstats.mru_hits: 0
kstat.zfs.misc.arcstats.prefetch_metadata_misses: 0
kstat.zfs.misc.arcstats.prefetch_metadata_hits: 0
kstat.zfs.misc.arcstats.prefetch_data_misses: 0
kstat.zfs.misc.arcstats.prefetch_data_hits: 0
kstat.zfs.misc.arcstats.demand_metadata_misses: 0
kstat.zfs.misc.arcstats.demand_metadata_hits: 0
kstat.zfs.misc.arcstats.demand_data_misses: 0
kstat.zfs.misc.arcstats.demand_data_hits: 0
kstat.zfs.misc.arcstats.misses: 0
kstat.zfs.misc.arcstats.hits: 0
kstat.zfs.misc.dmu_tx.dmu_tx_quota: 0
kstat.zfs.misc.dmu_tx.dmu_tx_dirty_frees_delay: 0
kstat.zfs.misc.dmu_tx.dmu_tx_dirty_over_max: 0
kstat.zfs.misc.dmu_tx.dmu_tx_dirty_delay: 0
kstat.zfs.misc.dmu_tx.dmu_tx_dirty_throttle: 0
kstat.zfs.misc.dmu_tx.dmu_tx_memory_reclaim: 0
kstat.zfs.misc.dmu_tx.dmu_tx_memory_reserve: 0
kstat.zfs.misc.dmu_tx.dmu_tx_group: 0
kstat.zfs.misc.dmu_tx.dmu_tx_suspended: 0
kstat.zfs.misc.dmu_tx.dmu_tx_error: 0
kstat.zfs.misc.dmu_tx.dmu_tx_delay: 0
kstat.zfs.misc.dmu_tx.dmu_tx_assigned: 0
kstat.zfs.misc.zfetchstats.max_streams: 0
kstat.zfs.misc.zfetchstats.misses: 0
kstat.zfs.misc.zfetchstats.hits: 0

I don't have any pools imported so a lot of things that would have values set don't. Is this what you're looking for?