aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/dbuf.h
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-09-27 17:08:38 -0700
committerGitHub <[email protected]>2020-09-27 17:08:38 -0700
commitaf20b97078af7bf4ba7552dff04cc40b643ab72c (patch)
treef2588e170caba562ff55808458276ca5796b2211 /include/sys/dbuf.h
parentcf2667759f4583bddd4b6ce8167e48b041ae1ea3 (diff)
zfetch: Don't issue new streams when old have not completed
The current dmu_zfetch code implicitly assumes that I/Os complete within min_sec_reap seconds. With async dmu and a readonly workload (and thus no exponential backoff in operations from the "write throttle") such as L2ARC rebuild it is possible to saturate the drives with I/O requests. These are then effectively compounded with prefetch requests. This change reference counts streams and prevents them from being recycled after their min_sec_reap timeout if they still have outstanding I/Os. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10900
Diffstat (limited to 'include/sys/dbuf.h')
-rw-r--r--include/sys/dbuf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h
index 04338b2c4..ca2154e12 100644
--- a/include/sys/dbuf.h
+++ b/include/sys/dbuf.h
@@ -309,6 +309,8 @@ typedef struct dbuf_hash_table {
kmutex_t hash_mutexes[DBUF_MUTEXES];
} dbuf_hash_table_t;
+typedef void (*dbuf_prefetch_fn)(void *, boolean_t);
+
uint64_t dbuf_whichblock(const struct dnode *di, const int64_t level,
const uint64_t offset);
@@ -324,7 +326,10 @@ int dbuf_hold_impl(struct dnode *dn, uint8_t level, uint64_t blkid,
boolean_t fail_sparse, boolean_t fail_uncached,
void *tag, dmu_buf_impl_t **dbp);
-void dbuf_prefetch(struct dnode *dn, int64_t level, uint64_t blkid,
+int dbuf_prefetch_impl(struct dnode *dn, int64_t level, uint64_t blkid,
+ zio_priority_t prio, arc_flags_t aflags, dbuf_prefetch_fn cb,
+ void *arg);
+int dbuf_prefetch(struct dnode *dn, int64_t level, uint64_t blkid,
zio_priority_t prio, arc_flags_t aflags);
void dbuf_add_ref(dmu_buf_impl_t *db, void *tag);