@@ -648,13 +648,6 @@ arc_sums_t arc_sums;
648
648
} while (0)
649
649
650
650
kstat_t * arc_ksp ;
651
- static arc_state_t * arc_anon ;
652
- static arc_state_t * arc_mru_ghost ;
653
- static arc_state_t * arc_mfu_ghost ;
654
- static arc_state_t * arc_l2c_only ;
655
-
656
- arc_state_t * arc_mru ;
657
- arc_state_t * arc_mfu ;
658
651
659
652
/*
660
653
* There are several ARC variables that are critical to export as kstats --
@@ -2197,7 +2190,6 @@ arc_evictable_space_increment(arc_buf_hdr_t *hdr, arc_state_t *state)
2197
2190
return ;
2198
2191
}
2199
2192
2200
- ASSERT (!GHOST_STATE (state ));
2201
2193
if (hdr -> b_l1hdr .b_pabd != NULL ) {
2202
2194
(void ) zfs_refcount_add_many (& state -> arcs_esize [type ],
2203
2195
arc_hdr_size (hdr ), hdr );
@@ -2238,7 +2230,6 @@ arc_evictable_space_decrement(arc_buf_hdr_t *hdr, arc_state_t *state)
2238
2230
return ;
2239
2231
}
2240
2232
2241
- ASSERT (!GHOST_STATE (state ));
2242
2233
if (hdr -> b_l1hdr .b_pabd != NULL ) {
2243
2234
(void ) zfs_refcount_remove_many (& state -> arcs_esize [type ],
2244
2235
arc_hdr_size (hdr ), hdr );
@@ -4010,23 +4001,21 @@ arc_set_need_free(void)
4010
4001
4011
4002
static uint64_t
4012
4003
arc_evict_state_impl (multilist_t * ml , int idx , arc_buf_hdr_t * marker ,
4013
- uint64_t spa , int64_t bytes )
4004
+ uint64_t spa , uint64_t bytes )
4014
4005
{
4015
4006
multilist_sublist_t * mls ;
4016
4007
uint64_t bytes_evicted = 0 ;
4017
4008
arc_buf_hdr_t * hdr ;
4018
4009
kmutex_t * hash_lock ;
4019
- int evict_count = 0 ;
4010
+ int evict_count = zfs_arc_evict_batch_limit ;
4020
4011
4021
4012
ASSERT3P (marker , != , NULL );
4022
- IMPLY (bytes < 0 , bytes == ARC_EVICT_ALL );
4023
4013
4024
4014
mls = multilist_sublist_lock (ml , idx );
4025
4015
4026
- for (hdr = multilist_sublist_prev (mls , marker ); hdr != NULL ;
4016
+ for (hdr = multilist_sublist_prev (mls , marker ); likely ( hdr != NULL ) ;
4027
4017
hdr = multilist_sublist_prev (mls , marker )) {
4028
- if ((bytes != ARC_EVICT_ALL && bytes_evicted >= bytes ) ||
4029
- (evict_count >= zfs_arc_evict_batch_limit ))
4018
+ if ((bytes_evicted >= bytes ) || (evict_count < 0 ))
4030
4019
break ;
4031
4020
4032
4021
/*
@@ -4085,7 +4074,7 @@ arc_evict_state_impl(multilist_t *ml, int idx, arc_buf_hdr_t *marker,
4085
4074
* evict_count in this case.
4086
4075
*/
4087
4076
if (evicted != 0 )
4088
- evict_count ++ ;
4077
+ evict_count -- ;
4089
4078
4090
4079
} else {
4091
4080
ARCSTAT_BUMP (arcstat_mutex_miss );
@@ -4146,16 +4135,14 @@ arc_evict_state_impl(multilist_t *ml, int idx, arc_buf_hdr_t *marker,
4146
4135
* the given arc state; which is used by arc_flush().
4147
4136
*/
4148
4137
static uint64_t
4149
- arc_evict_state (arc_state_t * state , uint64_t spa , int64_t bytes ,
4138
+ arc_evict_state (arc_state_t * state , uint64_t spa , uint64_t bytes ,
4150
4139
arc_buf_contents_t type )
4151
4140
{
4152
4141
uint64_t total_evicted = 0 ;
4153
4142
multilist_t * ml = & state -> arcs_list [type ];
4154
4143
int num_sublists ;
4155
4144
arc_buf_hdr_t * * markers ;
4156
4145
4157
- IMPLY (bytes < 0 , bytes == ARC_EVICT_ALL );
4158
-
4159
4146
num_sublists = multilist_get_num_sublists (ml );
4160
4147
4161
4148
/*
@@ -4187,7 +4174,7 @@ arc_evict_state(arc_state_t *state, uint64_t spa, int64_t bytes,
4187
4174
* While we haven't hit our target number of bytes to evict, or
4188
4175
* we're evicting all available buffers.
4189
4176
*/
4190
- while (total_evicted < bytes || bytes == ARC_EVICT_ALL ) {
4177
+ while (total_evicted < bytes ) {
4191
4178
int sublist_idx = multilist_get_random_index (ml );
4192
4179
uint64_t scan_evicted = 0 ;
4193
4180
@@ -4215,9 +4202,7 @@ arc_evict_state(arc_state_t *state, uint64_t spa, int64_t bytes,
4215
4202
uint64_t bytes_remaining ;
4216
4203
uint64_t bytes_evicted ;
4217
4204
4218
- if (bytes == ARC_EVICT_ALL )
4219
- bytes_remaining = ARC_EVICT_ALL ;
4220
- else if (total_evicted < bytes )
4205
+ if (total_evicted < bytes )
4221
4206
bytes_remaining = bytes - total_evicted ;
4222
4207
else
4223
4208
break ;
@@ -4312,7 +4297,7 @@ static uint64_t
4312
4297
arc_evict_impl (arc_state_t * state , uint64_t spa , int64_t bytes ,
4313
4298
arc_buf_contents_t type )
4314
4299
{
4315
- int64_t delta ;
4300
+ uint64_t delta ;
4316
4301
4317
4302
if (bytes > 0 && zfs_refcount_count (& state -> arcs_esize [type ]) > 0 ) {
4318
4303
delta = MIN (zfs_refcount_count (& state -> arcs_esize [type ]),
@@ -7563,13 +7548,6 @@ arc_tuning_update(boolean_t verbose)
7563
7548
static void
7564
7549
arc_state_init (void )
7565
7550
{
7566
- arc_anon = & ARC_anon ;
7567
- arc_mru = & ARC_mru ;
7568
- arc_mru_ghost = & ARC_mru_ghost ;
7569
- arc_mfu = & ARC_mfu ;
7570
- arc_mfu_ghost = & ARC_mfu_ghost ;
7571
- arc_l2c_only = & ARC_l2c_only ;
7572
-
7573
7551
multilist_create (& arc_mru -> arcs_list [ARC_BUFC_METADATA ],
7574
7552
sizeof (arc_buf_hdr_t ),
7575
7553
offsetof(arc_buf_hdr_t , b_l1hdr .b_arc_node ),
0 commit comments