@@ -298,25 +298,137 @@ typedef struct arc_stats {
298
298
kstat_named_t arcstat_c_min ;
299
299
kstat_named_t arcstat_c_max ;
300
300
kstat_named_t arcstat_size ;
301
+ /*
302
+ * Number of bytes consumed by internal ARC structures necessary
303
+ * for tracking purposes; these structures are not actually
304
+ * backed by ARC buffers. This includes arc_buf_hdr_t structures
305
+ * (allocated via arc_buf_hdr_t_full and arc_buf_hdr_t_l2only
306
+ * caches), and arc_buf_t structures (allocated via arc_buf_t
307
+ * cache).
308
+ */
301
309
kstat_named_t arcstat_hdr_size ;
310
+ /*
311
+ * Number of bytes consumed by ARC buffers of type equal to
312
+ * ARC_BUFC_DATA. This is generally consumed by buffers backing
313
+ * on disk user data (e.g. plain file contents).
314
+ */
302
315
kstat_named_t arcstat_data_size ;
303
- kstat_named_t arcstat_meta_size ;
316
+ /*
317
+ * Number of bytes consumed by ARC buffers of type equal to
318
+ * ARC_BUFC_METADATA. This is generally consumed by buffers
319
+ * backing on disk data that is used for internal ZFS
320
+ * structures (e.g. ZAP, dnode, indirect blocks, etc).
321
+ */
322
+ kstat_named_t arcstat_metadata_size ;
323
+ /*
324
+ * Number of bytes consumed by various buffers and structures
325
+ * not actually backed with ARC buffers. This includes bonus
326
+ * buffers (allocated directly via zio_buf_* functions),
327
+ * dmu_buf_impl_t structures (allocated via dmu_buf_impl_t
328
+ * cache), and dnode_t structures (allocated via dnode_t cache).
329
+ */
304
330
kstat_named_t arcstat_other_size ;
331
+ /*
332
+ * Total number of bytes consumed by ARC buffers residing in the
333
+ * arc_anon state. This includes *all* buffers in the arc_anon
334
+ * state; e.g. data, metadata, evictable, and unevictable buffers
335
+ * are all included in this value.
336
+ */
305
337
kstat_named_t arcstat_anon_size ;
306
- kstat_named_t arcstat_anon_evict_data ;
307
- kstat_named_t arcstat_anon_evict_metadata ;
338
+ /*
339
+ * Number of bytes consumed by ARC buffers that meet the
340
+ * following criteria: backing buffers of type ARC_BUFC_DATA,
341
+ * residing in the arc_anon state, and are eligible for eviction
342
+ * (e.g. have no outstanding holds on the buffer).
343
+ */
344
+ kstat_named_t arcstat_anon_evictable_data ;
345
+ /*
346
+ * Number of bytes consumed by ARC buffers that meet the
347
+ * following criteria: backing buffers of type ARC_BUFC_METADATA,
348
+ * residing in the arc_anon state, and are eligible for eviction
349
+ * (e.g. have no outstanding holds on the buffer).
350
+ */
351
+ kstat_named_t arcstat_anon_evictable_metadata ;
352
+ /*
353
+ * Total number of bytes consumed by ARC buffers residing in the
354
+ * arc_mru state. This includes *all* buffers in the arc_mru
355
+ * state; e.g. data, metadata, evictable, and unevictable buffers
356
+ * are all included in this value.
357
+ */
308
358
kstat_named_t arcstat_mru_size ;
309
- kstat_named_t arcstat_mru_evict_data ;
310
- kstat_named_t arcstat_mru_evict_metadata ;
359
+ /*
360
+ * Number of bytes consumed by ARC buffers that meet the
361
+ * following criteria: backing buffers of type ARC_BUFC_DATA,
362
+ * residing in the arc_mru state, and are eligible for eviction
363
+ * (e.g. have no outstanding holds on the buffer).
364
+ */
365
+ kstat_named_t arcstat_mru_evictable_data ;
366
+ /*
367
+ * Number of bytes consumed by ARC buffers that meet the
368
+ * following criteria: backing buffers of type ARC_BUFC_METADATA,
369
+ * residing in the arc_mru state, and are eligible for eviction
370
+ * (e.g. have no outstanding holds on the buffer).
371
+ */
372
+ kstat_named_t arcstat_mru_evictable_metadata ;
373
+ /*
374
+ * Total number of bytes that *would have been* consumed by ARC
375
+ * buffers in the arc_mru_ghost state. The key thing to note
376
+ * here, is the fact that this size doesn't actually indicate
377
+ * RAM consumption. The ghost lists only consist of headers and
378
+ * don't actually have ARC buffers linked off of these headers.
379
+ * Thus, *if* the headers had associated ARC buffers, these
380
+ * buffers *would have* consumed this number of bytes.
381
+ */
311
382
kstat_named_t arcstat_mru_ghost_size ;
312
- kstat_named_t arcstat_mru_ghost_evict_data ;
313
- kstat_named_t arcstat_mru_ghost_evict_metadata ;
383
+ /*
384
+ * Number of bytes that *would have been* consumed by ARC
385
+ * buffers that are eligible for eviction, of type
386
+ * ARC_BUFC_DATA, and linked off the arc_mru_ghost state.
387
+ */
388
+ kstat_named_t arcstat_mru_ghost_evictable_data ;
389
+ /*
390
+ * Number of bytes that *would have been* consumed by ARC
391
+ * buffers that are eligible for eviction, of type
392
+ * ARC_BUFC_METADATA, and linked off the arc_mru_ghost state.
393
+ */
394
+ kstat_named_t arcstat_mru_ghost_evictable_metadata ;
395
+ /*
396
+ * Total number of bytes consumed by ARC buffers residing in the
397
+ * arc_mfu state. This includes *all* buffers in the arc_mfu
398
+ * state; e.g. data, metadata, evictable, and unevictable buffers
399
+ * are all included in this value.
400
+ */
314
401
kstat_named_t arcstat_mfu_size ;
315
- kstat_named_t arcstat_mfu_evict_data ;
316
- kstat_named_t arcstat_mfu_evict_metadata ;
402
+ /*
403
+ * Number of bytes consumed by ARC buffers that are eligible for
404
+ * eviction, of type ARC_BUFC_DATA, and reside in the arc_mfu
405
+ * state.
406
+ */
407
+ kstat_named_t arcstat_mfu_evictable_data ;
408
+ /*
409
+ * Number of bytes consumed by ARC buffers that are eligible for
410
+ * eviction, of type ARC_BUFC_METADATA, and reside in the
411
+ * arc_mfu state.
412
+ */
413
+ kstat_named_t arcstat_mfu_evictable_metadata ;
414
+ /*
415
+ * Total number of bytes that *would have been* consumed by ARC
416
+ * buffers in the arc_mfu_ghost state. See the comment above
417
+ * arcstat_mru_ghost_size for more details.
418
+ */
317
419
kstat_named_t arcstat_mfu_ghost_size ;
318
- kstat_named_t arcstat_mfu_ghost_evict_data ;
319
- kstat_named_t arcstat_mfu_ghost_evict_metadata ;
420
+ /*
421
+ * Number of bytes that *would have been* consumed by ARC
422
+ * buffers that are eligible for eviction, of type
423
+ * ARC_BUFC_DATA, and linked off the arc_mfu_ghost state.
424
+ */
425
+ kstat_named_t arcstat_mfu_ghost_evictable_data ;
426
+ /*
427
+ * Number of bytes that *would have been* consumed by ARC
428
+ * buffers that are eligible for eviction, of type
429
+ * ARC_BUFC_METADATA, and linked off the arc_mru_ghost state.
430
+ */
431
+ kstat_named_t arcstat_mfu_ghost_evictable_metadata ;
320
432
kstat_named_t arcstat_l2_hits ;
321
433
kstat_named_t arcstat_l2_misses ;
322
434
kstat_named_t arcstat_l2_feeds ;
@@ -392,23 +504,23 @@ static arc_stats_t arc_stats = {
392
504
{ "size" , KSTAT_DATA_UINT64 },
393
505
{ "hdr_size" , KSTAT_DATA_UINT64 },
394
506
{ "data_size" , KSTAT_DATA_UINT64 },
395
- { "meta_size" , KSTAT_DATA_UINT64 },
507
+ { "metadata_size" , KSTAT_DATA_UINT64 },
396
508
{ "other_size" , KSTAT_DATA_UINT64 },
397
509
{ "anon_size" , KSTAT_DATA_UINT64 },
398
- { "anon_evict_data" , KSTAT_DATA_UINT64 },
399
- { "anon_evict_metadata " , KSTAT_DATA_UINT64 },
510
+ { "anon_evictable_data" , KSTAT_DATA_UINT64 },
511
+ { "anon_evictable_metadata " , KSTAT_DATA_UINT64 },
400
512
{ "mru_size" , KSTAT_DATA_UINT64 },
401
- { "mru_evict_data " , KSTAT_DATA_UINT64 },
402
- { "mru_evict_metadata" , KSTAT_DATA_UINT64 },
513
+ { "mru_evictable_data " , KSTAT_DATA_UINT64 },
514
+ { "mru_evictable_metadata" , KSTAT_DATA_UINT64 },
403
515
{ "mru_ghost_size" , KSTAT_DATA_UINT64 },
404
- { "mru_ghost_evict_data " , KSTAT_DATA_UINT64 },
405
- { "mru_ghost_evict_metadata" , KSTAT_DATA_UINT64 },
516
+ { "mru_ghost_evictable_data " , KSTAT_DATA_UINT64 },
517
+ { "mru_ghost_evictable_metadata" , KSTAT_DATA_UINT64 },
406
518
{ "mfu_size" , KSTAT_DATA_UINT64 },
407
- { "mfu_evict_data " , KSTAT_DATA_UINT64 },
408
- { "mfu_evict_metadata" , KSTAT_DATA_UINT64 },
519
+ { "mfu_evictable_data " , KSTAT_DATA_UINT64 },
520
+ { "mfu_evictable_metadata" , KSTAT_DATA_UINT64 },
409
521
{ "mfu_ghost_size" , KSTAT_DATA_UINT64 },
410
- { "mfu_ghost_evict_data " , KSTAT_DATA_UINT64 },
411
- { "mfu_ghost_evict_metadata" , KSTAT_DATA_UINT64 },
522
+ { "mfu_ghost_evictable_data " , KSTAT_DATA_UINT64 },
523
+ { "mfu_ghost_evictable_metadata" , KSTAT_DATA_UINT64 },
412
524
{ "l2_hits" , KSTAT_DATA_UINT64 },
413
525
{ "l2_misses" , KSTAT_DATA_UINT64 },
414
526
{ "l2_feeds" , KSTAT_DATA_UINT64 },
@@ -446,7 +558,7 @@ static arc_stats_t arc_stats = {
446
558
{ "arc_meta_used" , KSTAT_DATA_UINT64 },
447
559
{ "arc_meta_limit" , KSTAT_DATA_UINT64 },
448
560
{ "arc_meta_max" , KSTAT_DATA_UINT64 },
449
- { "arc_meta_min" , KSTAT_DATA_UINT64 },
561
+ { "arc_meta_min" , KSTAT_DATA_UINT64 }
450
562
};
451
563
452
564
#define ARCSTAT (stat ) (arc_stats.stat.value.ui64)
@@ -1470,7 +1582,7 @@ arc_space_consume(uint64_t space, arc_space_type_t type)
1470
1582
ARCSTAT_INCR (arcstat_data_size , space );
1471
1583
break ;
1472
1584
case ARC_SPACE_META :
1473
- ARCSTAT_INCR (arcstat_meta_size , space );
1585
+ ARCSTAT_INCR (arcstat_metadata_size , space );
1474
1586
break ;
1475
1587
case ARC_SPACE_OTHER :
1476
1588
ARCSTAT_INCR (arcstat_other_size , space );
@@ -1483,11 +1595,8 @@ arc_space_consume(uint64_t space, arc_space_type_t type)
1483
1595
break ;
1484
1596
}
1485
1597
1486
- if (type != ARC_SPACE_DATA ) {
1598
+ if (type != ARC_SPACE_DATA )
1487
1599
ARCSTAT_INCR (arcstat_meta_used , space );
1488
- if (arc_meta_max < arc_meta_used )
1489
- arc_meta_max = arc_meta_used ;
1490
- }
1491
1600
1492
1601
atomic_add_64 (& arc_size , space );
1493
1602
}
@@ -1504,7 +1613,7 @@ arc_space_return(uint64_t space, arc_space_type_t type)
1504
1613
ARCSTAT_INCR (arcstat_data_size , - space );
1505
1614
break ;
1506
1615
case ARC_SPACE_META :
1507
- ARCSTAT_INCR (arcstat_meta_size , - space );
1616
+ ARCSTAT_INCR (arcstat_metadata_size , - space );
1508
1617
break ;
1509
1618
case ARC_SPACE_OTHER :
1510
1619
ARCSTAT_INCR (arcstat_other_size , - space );
@@ -1519,6 +1628,8 @@ arc_space_return(uint64_t space, arc_space_type_t type)
1519
1628
1520
1629
if (type != ARC_SPACE_DATA ) {
1521
1630
ASSERT (arc_meta_used >= space );
1631
+ if (arc_meta_max < arc_meta_used )
1632
+ arc_meta_max = arc_meta_used ;
1522
1633
ARCSTAT_INCR (arcstat_meta_used , - space );
1523
1634
}
1524
1635
@@ -4971,28 +5082,28 @@ arc_kstat_update(kstat_t *ksp, int rw)
4971
5082
arc_stats_t * as = ksp -> ks_data ;
4972
5083
4973
5084
if (rw == KSTAT_WRITE ) {
4974
- return (SET_ERROR ( EACCES ) );
5085
+ return (EACCES );
4975
5086
} else {
4976
5087
arc_kstat_update_state (arc_anon ,
4977
5088
& as -> arcstat_anon_size ,
4978
- & as -> arcstat_anon_evict_data ,
4979
- & as -> arcstat_anon_evict_metadata );
5089
+ & as -> arcstat_anon_evictable_data ,
5090
+ & as -> arcstat_anon_evictable_metadata );
4980
5091
arc_kstat_update_state (arc_mru ,
4981
5092
& as -> arcstat_mru_size ,
4982
- & as -> arcstat_mru_evict_data ,
4983
- & as -> arcstat_mru_evict_metadata );
5093
+ & as -> arcstat_mru_evictable_data ,
5094
+ & as -> arcstat_mru_evictable_metadata );
4984
5095
arc_kstat_update_state (arc_mru_ghost ,
4985
5096
& as -> arcstat_mru_ghost_size ,
4986
- & as -> arcstat_mru_ghost_evict_data ,
4987
- & as -> arcstat_mru_ghost_evict_metadata );
5097
+ & as -> arcstat_mru_ghost_evictable_data ,
5098
+ & as -> arcstat_mru_ghost_evictable_metadata );
4988
5099
arc_kstat_update_state (arc_mfu ,
4989
5100
& as -> arcstat_mfu_size ,
4990
- & as -> arcstat_mfu_evict_data ,
4991
- & as -> arcstat_mfu_evict_metadata );
5101
+ & as -> arcstat_mfu_evictable_data ,
5102
+ & as -> arcstat_mfu_evictable_metadata );
4992
5103
arc_kstat_update_state (arc_mfu_ghost ,
4993
5104
& as -> arcstat_mfu_ghost_size ,
4994
- & as -> arcstat_mfu_ghost_evict_data ,
4995
- & as -> arcstat_mfu_ghost_evict_metadata );
5105
+ & as -> arcstat_mfu_ghost_evictable_data ,
5106
+ & as -> arcstat_mfu_ghost_evictable_metadata );
4996
5107
}
4997
5108
4998
5109
return (0 );
0 commit comments