aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/arc.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2012-01-20 10:58:57 -0800
committerBrian Behlendorf <[email protected]>2012-02-27 08:59:10 -0800
commit570827e129ed81e066e894530bbe24642f473154 (patch)
tree90e9128a73735df10392a24280ade08031051b68 /module/zfs/arc.c
parent13be560d89e9de63bdf63e8187af2ceb90cf094d (diff)
Add 'dmu_tx' kstats entry
Keep counters for the various reasons that a thread may end up in txg_wait_open() waiting on a new txg. This can be useful when attempting to determine why a particular workload is under performing. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r--module/zfs/arc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index cfd4c7981..10317b642 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -138,6 +138,7 @@
#endif
#include <sys/callb.h>
#include <sys/kstat.h>
+#include <sys/dmu_tx.h>
#include <zfs_fletcher.h>
static kmutex_t arc_reclaim_thr_lock;
@@ -3584,6 +3585,7 @@ arc_memory_throttle(uint64_t reserve, uint64_t inflight_data, uint64_t txg)
} else if (page_load > 0 && arc_reclaim_needed()) {
/* memory is low, delay before restarting */
ARCSTAT_INCR(arcstat_memory_throttle_count, 1);
+ DMU_TX_STAT_BUMP(dmu_tx_memory_reclaim);
return (EAGAIN);
}
page_load = 0;
@@ -3599,6 +3601,7 @@ arc_memory_throttle(uint64_t reserve, uint64_t inflight_data, uint64_t txg)
if (inflight_data > available_memory / 4) {
ARCSTAT_INCR(arcstat_memory_throttle_count, 1);
+ DMU_TX_STAT_BUMP(dmu_tx_memory_inflight);
return (ERESTART);
}
#endif
@@ -3629,8 +3632,10 @@ arc_tempreserve_space(uint64_t reserve, uint64_t txg)
#endif
if (reserve > arc_c/4 && !arc_no_grow)
arc_c = MIN(arc_c_max, reserve * 4);
- if (reserve > arc_c)
+ if (reserve > arc_c) {
+ DMU_TX_STAT_BUMP(dmu_tx_memory_reserve);
return (ENOMEM);
+ }
/*
* Don't count loaned bufs as in flight dirty data to prevent long
@@ -3663,6 +3668,7 @@ arc_tempreserve_space(uint64_t reserve, uint64_t txg)
arc_anon->arcs_lsize[ARC_BUFC_METADATA]>>10,
arc_anon->arcs_lsize[ARC_BUFC_DATA]>>10,
reserve>>10, arc_c>>10);
+ DMU_TX_STAT_BUMP(dmu_tx_dirty_throttle);
return (ERESTART);
}
atomic_add_64(&arc_tempreserve, reserve);