aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2022-12-13 20:29:21 -0500
committerGitHub <[email protected]>2022-12-13 17:29:21 -0800
commit3236c0b891d0a09475bef8b6186ac8beed792fe9 (patch)
tree03c7049b8548301ef8830fc2a2141afa8aa7a3c4 /include/sys
parentdc95911d21a19930848302aac9283fff68e4a41b (diff)
Cache dbuf_hash() calculation
We currently compute a 64-bit hash three times, which consumes 0.8% CPU time on ARC eviction heavy workloads. Caching the 64-bit value in the dbuf allows us to avoid that overhead. Sponsored-By: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #14251
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/dbuf.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h
index 9ba46f0d7..6215a2c12 100644
--- a/include/sys/dbuf.h
+++ b/include/sys/dbuf.h
@@ -294,6 +294,8 @@ typedef struct dmu_buf_impl {
/* Tells us which dbuf cache this dbuf is in, if any */
dbuf_cached_state_t db_caching_status;
+ uint64_t db_hash;
+
/* Data which is unique to data (leaf) blocks: */
/* User callback information. */
@@ -364,7 +366,7 @@ void dbuf_rele_and_unlock(dmu_buf_impl_t *db, const void *tag,
boolean_t evicting);
dmu_buf_impl_t *dbuf_find(struct objset *os, uint64_t object, uint8_t level,
- uint64_t blkid);
+ uint64_t blkid, uint64_t *hash_out);
int dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags);
void dmu_buf_will_not_fill(dmu_buf_t *db, dmu_tx_t *tx);