diff options
author | Adam D. Moss <[email protected]> | 2020-09-25 13:49:22 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-25 13:49:22 -0700 |
commit | acfd2d4641a137a1a22c206597ef951d406a1cf6 (patch) | |
tree | f58fdcc36396fea81676a88eb66f15aa7c1a8044 /module/zfs/dnode.c | |
parent | 2e407941a2148ab400d8b4e3748cc894e411c0c4 (diff) |
Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c
Prefetching of dnodes in dbuf_read() can cause significant mutex
contention for some workloads and isn't very helpful. This is
because we already get 32 dnodes for each block read, and when
iterating over a directory we prefetch the dnodes in the directory.
Disable this prefetching to prevent the lock contention.
Reviewed-by: Brian Behlendorf <[email protected]>
Submitted-by: Adam Moss <[email protected]>
Submitted-by: Matthew Ahrens <[email protected]>
Signed-off-by: Adam Moss <[email protected]>
Closes #10877
Closes #10953
Diffstat (limited to 'module/zfs/dnode.c')
-rw-r--r-- | module/zfs/dnode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c index 30d20bfef..23364dbae 100644 --- a/module/zfs/dnode.c +++ b/module/zfs/dnode.c @@ -1355,7 +1355,8 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, int slots, * We do not need to decrypt to read the dnode so it doesn't matter * if we get the encrypted or decrypted version. */ - err = dbuf_read(db, NULL, DB_RF_CANFAIL | DB_RF_NO_DECRYPT); + err = dbuf_read(db, NULL, DB_RF_CANFAIL | + DB_RF_NO_DECRYPT | DB_RF_NOPREFETCH); if (err) { DNODE_STAT_BUMP(dnode_hold_dbuf_read); dbuf_rele(db, FTAG); @@ -2396,7 +2397,8 @@ dnode_next_offset_level(dnode_t *dn, int flags, uint64_t *offset, return (SET_ERROR(ESRCH)); } error = dbuf_read(db, NULL, - DB_RF_CANFAIL | DB_RF_HAVESTRUCT | DB_RF_NO_DECRYPT); + DB_RF_CANFAIL | DB_RF_HAVESTRUCT | + DB_RF_NO_DECRYPT | DB_RF_NOPREFETCH); if (error) { dbuf_rele(db, FTAG); return (error); |