HomeFreeBSD

Improve performance by using dmu_tx_hold_*_by_dnode()

Description

Improve performance by using dmu_tx_hold_*_by_dnode()

In zfs_write() and dmu_tx_hold_sa(), we can use dmu_tx_hold_*_by_dnode()
instead of dmu_tx_hold_*(), since we already have a dbuf from the target
dnode in hand. This eliminates some calls to dnode_hold(), which can be
expensive. This is especially impactful if several threads are
accessing objects that are in the same block of dnodes, because they
will contend for that dbuf's lock.

We are seeing 10-20% performance wins for the sequential_writes tests in
the performance test suite, when doing >=128K writes to files with
recordsize=8K.

This also removes some unnecessary casts that are in the area.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #9081

Details

Provenance
mahrensAuthored on Jul 30 2019, 4:18 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 30 2019, 4:18 PM
Parents
rG1e620c98727a: Revert "Develop tests for issues #5866 and #8858"
Branches
Unknown
Tags
Unknown