summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/arc_summary/arc_summary298
-rwxr-xr-xcmd/arc_summary/arc_summary329
-rwxr-xr-xcmd/arcstat/arcstat.in33
-rw-r--r--cmd/zdb/zdb.c2
4 files changed, 156 insertions, 6 deletions
diff --git a/cmd/arc_summary/arc_summary2 b/cmd/arc_summary/arc_summary2
index 5dc40d759..0ab91e0e1 100755
--- a/cmd/arc_summary/arc_summary2
+++ b/cmd/arc_summary/arc_summary2
@@ -219,12 +219,30 @@ def get_arc_summary(Kstat):
deleted = Kstat["kstat.zfs.misc.arcstats.deleted"]
mutex_miss = Kstat["kstat.zfs.misc.arcstats.mutex_miss"]
evict_skip = Kstat["kstat.zfs.misc.arcstats.evict_skip"]
+ evict_l2_cached = Kstat["kstat.zfs.misc.arcstats.evict_l2_cached"]
+ evict_l2_eligible = Kstat["kstat.zfs.misc.arcstats.evict_l2_eligible"]
+ evict_l2_eligible_mfu = Kstat["kstat.zfs.misc.arcstats.evict_l2_eligible_mfu"]
+ evict_l2_eligible_mru = Kstat["kstat.zfs.misc.arcstats.evict_l2_eligible_mru"]
+ evict_l2_ineligible = Kstat["kstat.zfs.misc.arcstats.evict_l2_ineligible"]
+ evict_l2_skip = Kstat["kstat.zfs.misc.arcstats.evict_l2_skip"]
# ARC Misc.
output["arc_misc"] = {}
output["arc_misc"]["deleted"] = fHits(deleted)
- output["arc_misc"]['mutex_miss'] = fHits(mutex_miss)
- output["arc_misc"]['evict_skips'] = fHits(evict_skip)
+ output["arc_misc"]["mutex_miss"] = fHits(mutex_miss)
+ output["arc_misc"]["evict_skips"] = fHits(evict_skip)
+ output["arc_misc"]["evict_l2_skip"] = fHits(evict_l2_skip)
+ output["arc_misc"]["evict_l2_cached"] = fBytes(evict_l2_cached)
+ output["arc_misc"]["evict_l2_eligible"] = fBytes(evict_l2_eligible)
+ output["arc_misc"]["evict_l2_eligible_mfu"] = {
+ 'per': fPerc(evict_l2_eligible_mfu, evict_l2_eligible),
+ 'num': fBytes(evict_l2_eligible_mfu),
+ }
+ output["arc_misc"]["evict_l2_eligible_mru"] = {
+ 'per': fPerc(evict_l2_eligible_mru, evict_l2_eligible),
+ 'num': fBytes(evict_l2_eligible_mru),
+ }
+ output["arc_misc"]["evict_l2_ineligible"] = fBytes(evict_l2_ineligible)
# ARC Sizing
arc_size = Kstat["kstat.zfs.misc.arcstats.size"]
@@ -340,8 +358,26 @@ def _arc_summary(Kstat):
sys.stdout.write("\tDeleted:\t\t\t\t%s\n" % arc['arc_misc']['deleted'])
sys.stdout.write("\tMutex Misses:\t\t\t\t%s\n" %
arc['arc_misc']['mutex_miss'])
- sys.stdout.write("\tEvict Skips:\t\t\t\t%s\n" %
+ sys.stdout.write("\tEviction Skips:\t\t\t\t%s\n" %
arc['arc_misc']['evict_skips'])
+ sys.stdout.write("\tEviction Skips Due to L2 Writes:\t%s\n" %
+ arc['arc_misc']['evict_l2_skip'])
+ sys.stdout.write("\tL2 Cached Evictions:\t\t\t%s\n" %
+ arc['arc_misc']['evict_l2_cached'])
+ sys.stdout.write("\tL2 Eligible Evictions:\t\t\t%s\n" %
+ arc['arc_misc']['evict_l2_eligible'])
+ sys.stdout.write("\tL2 Eligible MFU Evictions:\t%s\t%s\n" % (
+ arc['arc_misc']['evict_l2_eligible_mfu']['per'],
+ arc['arc_misc']['evict_l2_eligible_mfu']['num'],
+ )
+ )
+ sys.stdout.write("\tL2 Eligible MRU Evictions:\t%s\t%s\n" % (
+ arc['arc_misc']['evict_l2_eligible_mru']['per'],
+ arc['arc_misc']['evict_l2_eligible_mru']['num'],
+ )
+ )
+ sys.stdout.write("\tL2 Ineligible Evictions:\t\t%s\n" %
+ arc['arc_misc']['evict_l2_ineligible'])
sys.stdout.write("\n")
# ARC Sizing
@@ -677,6 +713,11 @@ def get_l2arc_summary(Kstat):
l2_writes_done = Kstat["kstat.zfs.misc.arcstats.l2_writes_done"]
l2_writes_error = Kstat["kstat.zfs.misc.arcstats.l2_writes_error"]
l2_writes_sent = Kstat["kstat.zfs.misc.arcstats.l2_writes_sent"]
+ l2_mfu_asize = Kstat["kstat.zfs.misc.arcstats.l2_mfu_asize"]
+ l2_mru_asize = Kstat["kstat.zfs.misc.arcstats.l2_mru_asize"]
+ l2_prefetch_asize = Kstat["kstat.zfs.misc.arcstats.l2_prefetch_asize"]
+ l2_bufc_data_asize = Kstat["kstat.zfs.misc.arcstats.l2_bufc_data_asize"]
+ l2_bufc_metadata_asize = Kstat["kstat.zfs.misc.arcstats.l2_bufc_metadata_asize"]
l2_access_total = (l2_hits + l2_misses)
output['l2_health_count'] = (l2_writes_error + l2_cksum_bad + l2_io_error)
@@ -699,7 +740,7 @@ def get_l2arc_summary(Kstat):
output["io_errors"] = fHits(l2_io_error)
output["l2_arc_size"] = {}
- output["l2_arc_size"]["adative"] = fBytes(l2_size)
+ output["l2_arc_size"]["adaptive"] = fBytes(l2_size)
output["l2_arc_size"]["actual"] = {
'per': fPerc(l2_asize, l2_size),
'num': fBytes(l2_asize)
@@ -708,6 +749,26 @@ def get_l2arc_summary(Kstat):
'per': fPerc(l2_hdr_size, l2_size),
'num': fBytes(l2_hdr_size),
}
+ output["l2_arc_size"]["mfu_asize"] = {
+ 'per': fPerc(l2_mfu_asize, l2_asize),
+ 'num': fBytes(l2_mfu_asize),
+ }
+ output["l2_arc_size"]["mru_asize"] = {
+ 'per': fPerc(l2_mru_asize, l2_asize),
+ 'num': fBytes(l2_mru_asize),
+ }
+ output["l2_arc_size"]["prefetch_asize"] = {
+ 'per': fPerc(l2_prefetch_asize, l2_asize),
+ 'num': fBytes(l2_prefetch_asize),
+ }
+ output["l2_arc_size"]["bufc_data_asize"] = {
+ 'per': fPerc(l2_bufc_data_asize, l2_asize),
+ 'num': fBytes(l2_bufc_data_asize),
+ }
+ output["l2_arc_size"]["bufc_metadata_asize"] = {
+ 'per': fPerc(l2_bufc_metadata_asize, l2_asize),
+ 'num': fBytes(l2_bufc_metadata_asize),
+ }
output["l2_arc_evicts"] = {}
output["l2_arc_evicts"]['lock_retries'] = fHits(l2_evict_lock_retry)
@@ -772,7 +833,7 @@ def _l2arc_summary(Kstat):
sys.stdout.write("\n")
sys.stdout.write("L2 ARC Size: (Adaptive)\t\t\t\t%s\n" %
- arc["l2_arc_size"]["adative"])
+ arc["l2_arc_size"]["adaptive"])
sys.stdout.write("\tCompressed:\t\t\t%s\t%s\n" % (
arc["l2_arc_size"]["actual"]["per"],
arc["l2_arc_size"]["actual"]["num"],
@@ -783,11 +844,36 @@ def _l2arc_summary(Kstat):
arc["l2_arc_size"]["head_size"]["num"],
)
)
+ sys.stdout.write("\tMFU Alloc. Size:\t\t%s\t%s\n" % (
+ arc["l2_arc_size"]["mfu_asize"]["per"],
+ arc["l2_arc_size"]["mfu_asize"]["num"],
+ )
+ )
+ sys.stdout.write("\tMRU Alloc. Size:\t\t%s\t%s\n" % (
+ arc["l2_arc_size"]["mru_asize"]["per"],
+ arc["l2_arc_size"]["mru_asize"]["num"],
+ )
+ )
+ sys.stdout.write("\tPrefetch Alloc. Size:\t\t%s\t%s\n" % (
+ arc["l2_arc_size"]["prefetch_asize"]["per"],
+ arc["l2_arc_size"]["prefetch_asize"]["num"],
+ )
+ )
+ sys.stdout.write("\tData (buf content) Alloc. Size:\t%s\t%s\n" % (
+ arc["l2_arc_size"]["bufc_data_asize"]["per"],
+ arc["l2_arc_size"]["bufc_data_asize"]["num"],
+ )
+ )
+ sys.stdout.write("\tMetadata (buf content) Size:\t%s\t%s\n" % (
+ arc["l2_arc_size"]["bufc_metadata_asize"]["per"],
+ arc["l2_arc_size"]["bufc_metadata_asize"]["num"],
+ )
+ )
sys.stdout.write("\n")
if arc["l2_arc_evicts"]['lock_retries'] != '0' or \
arc["l2_arc_evicts"]["reading"] != '0':
- sys.stdout.write("L2 ARC Evicts:\n")
+ sys.stdout.write("L2 ARC Evictions:\n")
sys.stdout.write("\tLock Retries:\t\t\t\t%s\n" %
arc["l2_arc_evicts"]['lock_retries'])
sys.stdout.write("\tUpon Reading:\t\t\t\t%s\n" %
diff --git a/cmd/arc_summary/arc_summary3 b/cmd/arc_summary/arc_summary3
index c920b8e53..6f600fa9c 100755
--- a/cmd/arc_summary/arc_summary3
+++ b/cmd/arc_summary/arc_summary3
@@ -598,6 +598,20 @@ def section_arc(kstats_dict):
prt_i1('Deleted:', f_hits(arc_stats['deleted']))
prt_i1('Mutex misses:', f_hits(arc_stats['mutex_miss']))
prt_i1('Eviction skips:', f_hits(arc_stats['evict_skip']))
+ prt_i1('Eviction skips due to L2 writes:',
+ f_hits(arc_stats['evict_l2_skip']))
+ prt_i1('L2 cached evictions:', f_bytes(arc_stats['evict_l2_cached']))
+ prt_i1('L2 eligible evictions:', f_bytes(arc_stats['evict_l2_eligible']))
+ prt_i2('L2 eligible MFU evictions:',
+ f_perc(arc_stats['evict_l2_eligible_mfu'],
+ arc_stats['evict_l2_eligible']),
+ f_bytes(arc_stats['evict_l2_eligible_mfu']))
+ prt_i2('L2 eligible MRU evictions:',
+ f_perc(arc_stats['evict_l2_eligible_mru'],
+ arc_stats['evict_l2_eligible']),
+ f_bytes(arc_stats['evict_l2_eligible_mru']))
+ prt_i1('L2 ineligible evictions:',
+ f_bytes(arc_stats['evict_l2_ineligible']))
print()
@@ -736,6 +750,21 @@ def section_l2arc(kstats_dict):
prt_i2('Header size:',
f_perc(arc_stats['l2_hdr_size'], arc_stats['l2_size']),
f_bytes(arc_stats['l2_hdr_size']))
+ prt_i2('MFU allocated size:',
+ f_perc(arc_stats['l2_mfu_asize'], arc_stats['l2_asize']),
+ f_bytes(arc_stats['l2_mfu_asize']))
+ prt_i2('MRU allocated size:',
+ f_perc(arc_stats['l2_mru_asize'], arc_stats['l2_asize']),
+ f_bytes(arc_stats['l2_mru_asize']))
+ prt_i2('Prefetch allocated size:',
+ f_perc(arc_stats['l2_prefetch_asize'], arc_stats['l2_asize']),
+ f_bytes(arc_stats['l2_prefetch_asize']))
+ prt_i2('Data (buffer content) allocated size:',
+ f_perc(arc_stats['l2_bufc_data_asize'], arc_stats['l2_asize']),
+ f_bytes(arc_stats['l2_bufc_data_asize']))
+ prt_i2('Metadata (buffer content) allocated size:',
+ f_perc(arc_stats['l2_bufc_metadata_asize'], arc_stats['l2_asize']),
+ f_bytes(arc_stats['l2_bufc_metadata_asize']))
print()
prt_1('L2ARC breakdown:', f_hits(l2_access_total))
diff --git a/cmd/arcstat/arcstat.in b/cmd/arcstat/arcstat.in
index c83a1c745..df0eb0c22 100755
--- a/cmd/arcstat/arcstat.in
+++ b/cmd/arcstat/arcstat.in
@@ -88,6 +88,12 @@ cols = {
"mfug": [4, 1000, "MFU ghost list hits per second"],
"mrug": [4, 1000, "MRU ghost list hits per second"],
"eskip": [5, 1000, "evict_skip per second"],
+ "el2skip": [7, 1000, "evict skip, due to l2 writes, per second"],
+ "el2cach": [7, 1024, "Size of L2 cached evictions per second"],
+ "el2el": [5, 1024, "Size of L2 eligible evictions per second"],
+ "el2mfu": [6, 1024, "Size of L2 eligible MFU evictions per second"],
+ "el2mru": [6, 1024, "Size of L2 eligible MRU evictions per second"],
+ "el2inel": [7, 1024, "Size of L2 ineligible evictions per second"],
"mtxmis": [6, 1000, "mutex_miss per second"],
"dread": [5, 1000, "Demand accesses per second"],
"pread": [5, 1000, "Prefetch accesses per second"],
@@ -96,6 +102,16 @@ cols = {
"l2read": [6, 1000, "Total L2ARC accesses per second"],
"l2hit%": [6, 100, "L2ARC access hit percentage"],
"l2miss%": [7, 100, "L2ARC access miss percentage"],
+ "l2pref": [6, 1024, "L2ARC prefetch allocated size"],
+ "l2mfu": [5, 1024, "L2ARC MFU allocated size"],
+ "l2mru": [5, 1024, "L2ARC MRU allocated size"],
+ "l2data": [6, 1024, "L2ARC data allocated size"],
+ "l2meta": [6, 1024, "L2ARC metadata allocated size"],
+ "l2pref%": [7, 100, "L2ARC prefetch percentage"],
+ "l2mfu%": [6, 100, "L2ARC MFU percentage"],
+ "l2mru%": [6, 100, "L2ARC MRU percentage"],
+ "l2data%": [7, 100, "L2ARC data percentage"],
+ "l2meta%": [7, 100, "L2ARC metadata percentage"],
"l2asize": [7, 1024, "Actual (compressed) size of the L2ARC"],
"l2size": [6, 1024, "Size of the L2ARC"],
"l2bytes": [7, 1024, "Bytes read per second from the L2ARC"],
@@ -436,6 +452,12 @@ def calculate():
v["mrug"] = d["mru_ghost_hits"] / sint
v["mfug"] = d["mfu_ghost_hits"] / sint
v["eskip"] = d["evict_skip"] / sint
+ v["el2skip"] = d["evict_l2_skip"] / sint
+ v["el2cach"] = d["evict_l2_cached"] / sint
+ v["el2el"] = d["evict_l2_eligible"] / sint
+ v["el2mfu"] = d["evict_l2_eligible_mfu"] / sint
+ v["el2mru"] = d["evict_l2_eligible_mru"] / sint
+ v["el2inel"] = d["evict_l2_ineligible"] / sint
v["mtxmis"] = d["mutex_miss"] / sint
if l2exist:
@@ -449,6 +471,17 @@ def calculate():
v["l2size"] = cur["l2_size"]
v["l2bytes"] = d["l2_read_bytes"] / sint
+ v["l2pref"] = cur["l2_prefetch_asize"]
+ v["l2mfu"] = cur["l2_mfu_asize"]
+ v["l2mru"] = cur["l2_mru_asize"]
+ v["l2data"] = cur["l2_bufc_data_asize"]
+ v["l2meta"] = cur["l2_bufc_metadata_asize"]
+ v["l2pref%"] = 100 * v["l2pref"] / v["l2asize"]
+ v["l2mfu%"] = 100 * v["l2mfu"] / v["l2asize"]
+ v["l2mru%"] = 100 * v["l2mru"] / v["l2asize"]
+ v["l2data%"] = 100 * v["l2data"] / v["l2asize"]
+ v["l2meta%"] = 100 * v["l2meta"] / v["l2asize"]
+
v["grow"] = 0 if cur["arc_no_grow"] else 1
v["need"] = cur["arc_need_free"]
v["free"] = cur["memory_free_bytes"]
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index e7211711a..fcceedfe5 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -4188,6 +4188,8 @@ dump_l2arc_log_entries(uint64_t log_entries,
(u_longlong_t)L2BLK_GET_PREFETCH((&le[j])->le_prop));
(void) printf("|\t\t\t\taddress: %llu\n",
(u_longlong_t)le[j].le_daddr);
+ (void) printf("|\t\t\t\tARC state: %llu\n",
+ (u_longlong_t)L2BLK_GET_STATE((&le[j])->le_prop));
(void) printf("|\n");
}
(void) printf("\n");