@@ -294,6 +294,9 @@ typedef struct arc_stats {
294
294
kstat_named_t arcstat_duplicate_buffers ;
295
295
kstat_named_t arcstat_duplicate_buffers_size ;
296
296
kstat_named_t arcstat_duplicate_reads ;
297
+ kstat_named_t arcstat_meta_used ;
298
+ kstat_named_t arcstat_meta_limit ;
299
+ kstat_named_t arcstat_meta_max ;
297
300
} arc_stats_t ;
298
301
299
302
static arc_stats_t arc_stats = {
@@ -352,7 +355,10 @@ static arc_stats_t arc_stats = {
352
355
{ "memory_throttle_count" , KSTAT_DATA_UINT64 },
353
356
{ "duplicate_buffers" , KSTAT_DATA_UINT64 },
354
357
{ "duplicate_buffers_size" , KSTAT_DATA_UINT64 },
355
- { "duplicate_reads" , KSTAT_DATA_UINT64 }
358
+ { "duplicate_reads" , KSTAT_DATA_UINT64 },
359
+ { "arc_meta_used" , KSTAT_DATA_UINT64 },
360
+ { "arc_meta_limit" , KSTAT_DATA_UINT64 },
361
+ { "arc_meta_max" , KSTAT_DATA_UINT64 }
356
362
};
357
363
358
364
#define ARCSTAT (stat ) (arc_stats.stat.value.ui64)
@@ -414,13 +420,13 @@ static arc_state_t *arc_l2c_only;
414
420
#define arc_c ARCSTAT(arcstat_c) /* target size of cache */
415
421
#define arc_c_min ARCSTAT(arcstat_c_min) /* min target cache size */
416
422
#define arc_c_max ARCSTAT(arcstat_c_max) /* max target cache size */
423
+ #define arc_meta_limit ARCSTAT(arcstat_meta_limit) /* max size for metadata */
424
+ #define arc_meta_used ARCSTAT(arcstat_meta_used) /* size of metadata */
425
+ #define arc_meta_max ARCSTAT(arcstat_meta_max) /* max size of metadata */
417
426
418
427
static int arc_no_grow ; /* Don't try to grow cache size */
419
428
static uint64_t arc_tempreserve ;
420
429
static uint64_t arc_loaned_bytes ;
421
- static uint64_t arc_meta_used ;
422
- static uint64_t arc_meta_limit ;
423
- static uint64_t arc_meta_max = 0 ;
424
430
425
431
typedef struct l2arc_buf_hdr l2arc_buf_hdr_t ;
426
432
@@ -1218,7 +1224,7 @@ arc_space_consume(uint64_t space, arc_space_type_t type)
1218
1224
break ;
1219
1225
}
1220
1226
1221
- atomic_add_64 ( & arc_meta_used , space );
1227
+ ARCSTAT_INCR ( arcstat_meta_used , space );
1222
1228
atomic_add_64 (& arc_size , space );
1223
1229
}
1224
1230
@@ -1245,7 +1251,7 @@ arc_space_return(uint64_t space, arc_space_type_t type)
1245
1251
ASSERT (arc_meta_used >= space );
1246
1252
if (arc_meta_max < arc_meta_used )
1247
1253
arc_meta_max = arc_meta_used ;
1248
- atomic_add_64 ( & arc_meta_used , - space );
1254
+ ARCSTAT_INCR ( arcstat_meta_used , - space );
1249
1255
ASSERT (arc_size >= space );
1250
1256
atomic_add_64 (& arc_size , - space );
1251
1257
}
0 commit comments