@@ -2631,7 +2631,7 @@ arc_space_consume(uint64_t space, arc_space_type_t type)
26312631 ARCSTAT_INCR (arcstat_bonus_size , space );
26322632 break ;
26332633 case ARC_SPACE_DNODE :
2634- ARCSTAT_INCR ( arcstat_dnode_size , space );
2634+ aggsum_add ( & arc_sums . arcstat_dnode_size , space );
26352635 break ;
26362636 case ARC_SPACE_DBUF :
26372637 ARCSTAT_INCR (arcstat_dbuf_size , space );
@@ -2677,7 +2677,7 @@ arc_space_return(uint64_t space, arc_space_type_t type)
26772677 ARCSTAT_INCR (arcstat_bonus_size , - space );
26782678 break ;
26792679 case ARC_SPACE_DNODE :
2680- ARCSTAT_INCR ( arcstat_dnode_size , - space );
2680+ aggsum_add ( & arc_sums . arcstat_dnode_size , - space );
26812681 break ;
26822682 case ARC_SPACE_DBUF :
26832683 ARCSTAT_INCR (arcstat_dbuf_size , - space );
@@ -4490,7 +4490,7 @@ arc_evict(void)
44904490 * target is not evictable or if they go over arc_dnode_limit.
44914491 */
44924492 int64_t prune = 0 ;
4493- int64_t dn = wmsum_value (& arc_sums .arcstat_dnode_size );
4493+ int64_t dn = aggsum_value (& arc_sums .arcstat_dnode_size );
44944494 int64_t nem = zfs_refcount_count (& arc_mru -> arcs_size [ARC_BUFC_METADATA ])
44954495 + zfs_refcount_count (& arc_mfu -> arcs_size [ARC_BUFC_METADATA ])
44964496 - zfs_refcount_count (& arc_mru -> arcs_esize [ARC_BUFC_METADATA ])
@@ -5082,11 +5082,13 @@ arc_is_overflowing(boolean_t lax, boolean_t use_reserve)
50825082 * in the ARC. In practice, that's in the tens of MB, which is low
50835083 * enough to be safe.
50845084 */
5085- int64_t over = aggsum_lower_bound (& arc_sums .arcstat_size ) - arc_c -
5085+ int64_t arc_over = aggsum_lower_bound (& arc_sums .arcstat_size ) - arc_c -
50865086 zfs_max_recordsize ;
5087+ int64_t dn_over = aggsum_lower_bound (& arc_sums .arcstat_dnode_size ) -
5088+ arc_dnode_limit ;
50875089
50885090 /* Always allow at least one block of overflow. */
5089- if (over < 0 )
5091+ if (arc_over < 0 && dn_over <= 0 )
50905092 return (ARC_OVF_NONE );
50915093
50925094 /* If we are under memory pressure, report severe overflow. */
@@ -5097,7 +5099,7 @@ arc_is_overflowing(boolean_t lax, boolean_t use_reserve)
50975099 int64_t overflow = (arc_c >> zfs_arc_overflow_shift ) / 2 ;
50985100 if (use_reserve )
50995101 overflow *= 3 ;
5100- return (over < overflow ? ARC_OVF_SOME : ARC_OVF_SEVERE );
5102+ return (arc_over < overflow ? ARC_OVF_SOME : ARC_OVF_SEVERE );
51015103}
51025104
51035105static abd_t *
@@ -7326,7 +7328,7 @@ arc_kstat_update(kstat_t *ksp, int rw)
73267328#if defined(COMPAT_FREEBSD11 )
73277329 as -> arcstat_other_size .value .ui64 =
73287330 wmsum_value (& arc_sums .arcstat_bonus_size ) +
7329- wmsum_value (& arc_sums .arcstat_dnode_size ) +
7331+ aggsum_value (& arc_sums .arcstat_dnode_size ) +
73307332 wmsum_value (& arc_sums .arcstat_dbuf_size );
73317333#endif
73327334
@@ -7368,7 +7370,7 @@ arc_kstat_update(kstat_t *ksp, int rw)
73687370 & as -> arcstat_uncached_evictable_metadata );
73697371
73707372 as -> arcstat_dnode_size .value .ui64 =
7371- wmsum_value (& arc_sums .arcstat_dnode_size );
7373+ aggsum_value (& arc_sums .arcstat_dnode_size );
73727374 as -> arcstat_bonus_size .value .ui64 =
73737375 wmsum_value (& arc_sums .arcstat_bonus_size );
73747376 as -> arcstat_l2_hits .value .ui64 =
@@ -7738,7 +7740,7 @@ arc_state_init(void)
77387740 wmsum_init (& arc_sums .arcstat_data_size , 0 );
77397741 wmsum_init (& arc_sums .arcstat_metadata_size , 0 );
77407742 wmsum_init (& arc_sums .arcstat_dbuf_size , 0 );
7741- wmsum_init (& arc_sums .arcstat_dnode_size , 0 );
7743+ aggsum_init (& arc_sums .arcstat_dnode_size , 0 );
77427744 wmsum_init (& arc_sums .arcstat_bonus_size , 0 );
77437745 wmsum_init (& arc_sums .arcstat_l2_hits , 0 );
77447746 wmsum_init (& arc_sums .arcstat_l2_misses , 0 );
@@ -7897,7 +7899,7 @@ arc_state_fini(void)
78977899 wmsum_fini (& arc_sums .arcstat_data_size );
78987900 wmsum_fini (& arc_sums .arcstat_metadata_size );
78997901 wmsum_fini (& arc_sums .arcstat_dbuf_size );
7900- wmsum_fini (& arc_sums .arcstat_dnode_size );
7902+ aggsum_fini (& arc_sums .arcstat_dnode_size );
79017903 wmsum_fini (& arc_sums .arcstat_bonus_size );
79027904 wmsum_fini (& arc_sums .arcstat_l2_hits );
79037905 wmsum_fini (& arc_sums .arcstat_l2_misses );
0 commit comments