diff options
author | Brian Behlendorf <[email protected]> | 2013-10-02 17:11:19 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-10-25 13:59:40 -0700 |
commit | e0b0ca983d6897bcddf05af2c0e5d01ff66f90db (patch) | |
tree | d6d3251e89a67f1a915f1a071313271e061af359 /include/sys/dbuf.h | |
parent | 2d37239a28b8b2ddc0e8312093f8d8810c6351fa (diff) |
Add visibility in to cached dbufs
Currently there is no mechanism to inspect which dbufs are being
cached by the system. There are some coarse counters in arcstats
by they only give a rough idea of what's being cached. This patch
aims to improve the current situation by adding a new dbufs kstat.
When read this new kstat will walk all cached dbufs linked in to
the dbuf_hash. For each dbuf it will dump detailed information
about the buffer. It will also dump additional information about
the referenced arc buffer and its related dnode. This provides a
more complete view in to exactly what is being cached.
With this generic infrastructure in place utilities can be written
to post-process the data to understand exactly how the caching is
working. For example, the data could be processed to show a list
of all cached dnodes and how much space they're consuming. Or a
similar list could be generated based on dnode type. Many other
ways to interpret the data exist based on what kinds of questions
you're trying to answer.
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Prakash Surya <[email protected]>
Diffstat (limited to 'include/sys/dbuf.h')
-rw-r--r-- | include/sys/dbuf.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h index 8cd1fde01..85e967d0f 100644 --- a/include/sys/dbuf.h +++ b/include/sys/dbuf.h @@ -282,6 +282,9 @@ void dbuf_free_range(struct dnode *dn, uint64_t start, uint64_t end, void dbuf_new_size(dmu_buf_impl_t *db, int size, dmu_tx_t *tx); +void dbuf_stats_init(dbuf_hash_table_t *hash); +void dbuf_stats_destroy(void); + #define DB_DNODE(_db) ((_db)->db_dnode_handle->dnh_dnode) #define DB_DNODE_LOCK(_db) ((_db)->db_dnode_handle->dnh_zrlock) #define DB_DNODE_ENTER(_db) (zrl_add(&DB_DNODE_LOCK(_db))) |