]> git.proxmox.com Git - mirror_zfs.git/commit
Add visibility in to txg sync behavior
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 1 Oct 2013 16:50:50 +0000 (09:50 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 25 Oct 2013 20:57:25 +0000 (13:57 -0700)
commit0b1401ee911c5a0c0bdb7a8e6ad36840cea3af24
treede82f4e044f88d0d4d94541adf9da19859191421
parent1421c89142376bfd41e4de22ed7c7846b9e41f95
Add visibility in to txg sync behavior

This change is an attempt to add visibility in to how txgs are being
formed on a system, in real time. To do this, a list was added to the
in memory SPA data structure for a pool, with each element on the list
corresponding to txg. These entries are then exported through the kstat
interface, which can then be interpreted in userspace.

For each txg, the following information is exported:

 * Unique txg number (uint64_t)
 * The time the txd was born (hrtime_t)
   (*not* wall clock time; relative to the other entries on the list)
 * The current txg state ((O)pen/(Q)uiescing/(S)yncing/(C)ommitted)
 * The number of reserved bytes for the txg (uint64_t)
 * The number of bytes read during the txg (uint64_t)
 * The number of bytes written during the txg (uint64_t)
 * The number of read operations during the txg (uint64_t)
 * The number of write operations during the txg (uint64_t)
 * The time the txg was closed (hrtime_t)
 * The time the txg was quiesced (hrtime_t)
 * The time the txg was synced (hrtime_t)

Note that while the raw kstat now stores relative hrtimes for the
open, quiesce, and sync times.  Those relative times are used to
calculate how long each state took and these deltas and printed by
output handlers.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/spa.h
module/zfs/spa_stats.c
module/zfs/txg.c