@@ -2631,7 +2631,7 @@ arc_space_consume(uint64_t space, arc_space_type_t type)
2631
2631
ARCSTAT_INCR (arcstat_bonus_size , space );
2632
2632
break ;
2633
2633
case ARC_SPACE_DNODE :
2634
- ARCSTAT_INCR ( arcstat_dnode_size , space );
2634
+ aggsum_add ( & arc_sums . arcstat_dnode_size , space );
2635
2635
break ;
2636
2636
case ARC_SPACE_DBUF :
2637
2637
ARCSTAT_INCR (arcstat_dbuf_size , space );
@@ -2677,7 +2677,7 @@ arc_space_return(uint64_t space, arc_space_type_t type)
2677
2677
ARCSTAT_INCR (arcstat_bonus_size , - space );
2678
2678
break ;
2679
2679
case ARC_SPACE_DNODE :
2680
- ARCSTAT_INCR ( arcstat_dnode_size , - space );
2680
+ aggsum_add ( & arc_sums . arcstat_dnode_size , - space );
2681
2681
break ;
2682
2682
case ARC_SPACE_DBUF :
2683
2683
ARCSTAT_INCR (arcstat_dbuf_size , - space );
@@ -4490,7 +4490,7 @@ arc_evict(void)
4490
4490
* target is not evictable or if they go over arc_dnode_limit.
4491
4491
*/
4492
4492
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 );
4494
4494
int64_t nem = zfs_refcount_count (& arc_mru -> arcs_size [ARC_BUFC_METADATA ])
4495
4495
+ zfs_refcount_count (& arc_mfu -> arcs_size [ARC_BUFC_METADATA ])
4496
4496
- zfs_refcount_count (& arc_mru -> arcs_esize [ARC_BUFC_METADATA ])
@@ -5082,11 +5082,13 @@ arc_is_overflowing(boolean_t lax, boolean_t use_reserve)
5082
5082
* in the ARC. In practice, that's in the tens of MB, which is low
5083
5083
* enough to be safe.
5084
5084
*/
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 -
5086
5086
zfs_max_recordsize ;
5087
+ int64_t dn_over = aggsum_lower_bound (& arc_sums .arcstat_dnode_size ) -
5088
+ arc_dnode_limit ;
5087
5089
5088
5090
/* Always allow at least one block of overflow. */
5089
- if (over < 0 )
5091
+ if (arc_over < 0 && dn_over <= 0 )
5090
5092
return (ARC_OVF_NONE );
5091
5093
5092
5094
/* If we are under memory pressure, report severe overflow. */
@@ -5097,7 +5099,7 @@ arc_is_overflowing(boolean_t lax, boolean_t use_reserve)
5097
5099
int64_t overflow = (arc_c >> zfs_arc_overflow_shift ) / 2 ;
5098
5100
if (use_reserve )
5099
5101
overflow *= 3 ;
5100
- return (over < overflow ? ARC_OVF_SOME : ARC_OVF_SEVERE );
5102
+ return (arc_over < overflow ? ARC_OVF_SOME : ARC_OVF_SEVERE );
5101
5103
}
5102
5104
5103
5105
static abd_t *
@@ -7326,7 +7328,7 @@ arc_kstat_update(kstat_t *ksp, int rw)
7326
7328
#if defined(COMPAT_FREEBSD11 )
7327
7329
as -> arcstat_other_size .value .ui64 =
7328
7330
wmsum_value (& arc_sums .arcstat_bonus_size ) +
7329
- wmsum_value (& arc_sums .arcstat_dnode_size ) +
7331
+ aggsum_value (& arc_sums .arcstat_dnode_size ) +
7330
7332
wmsum_value (& arc_sums .arcstat_dbuf_size );
7331
7333
#endif
7332
7334
@@ -7368,7 +7370,7 @@ arc_kstat_update(kstat_t *ksp, int rw)
7368
7370
& as -> arcstat_uncached_evictable_metadata );
7369
7371
7370
7372
as -> arcstat_dnode_size .value .ui64 =
7371
- wmsum_value (& arc_sums .arcstat_dnode_size );
7373
+ aggsum_value (& arc_sums .arcstat_dnode_size );
7372
7374
as -> arcstat_bonus_size .value .ui64 =
7373
7375
wmsum_value (& arc_sums .arcstat_bonus_size );
7374
7376
as -> arcstat_l2_hits .value .ui64 =
@@ -7738,7 +7740,7 @@ arc_state_init(void)
7738
7740
wmsum_init (& arc_sums .arcstat_data_size , 0 );
7739
7741
wmsum_init (& arc_sums .arcstat_metadata_size , 0 );
7740
7742
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 );
7742
7744
wmsum_init (& arc_sums .arcstat_bonus_size , 0 );
7743
7745
wmsum_init (& arc_sums .arcstat_l2_hits , 0 );
7744
7746
wmsum_init (& arc_sums .arcstat_l2_misses , 0 );
@@ -7897,7 +7899,7 @@ arc_state_fini(void)
7897
7899
wmsum_fini (& arc_sums .arcstat_data_size );
7898
7900
wmsum_fini (& arc_sums .arcstat_metadata_size );
7899
7901
wmsum_fini (& arc_sums .arcstat_dbuf_size );
7900
- wmsum_fini (& arc_sums .arcstat_dnode_size );
7902
+ aggsum_fini (& arc_sums .arcstat_dnode_size );
7901
7903
wmsum_fini (& arc_sums .arcstat_bonus_size );
7902
7904
wmsum_fini (& arc_sums .arcstat_l2_hits );
7903
7905
wmsum_fini (& arc_sums .arcstat_l2_misses );
0 commit comments