diff options
author | Matthew Ahrens <[email protected]> | 2020-04-10 21:14:01 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-10 21:14:01 -0700 |
commit | 20f287855a61a64a90e01edfd551ff28f7abdb5c (patch) | |
tree | 2fc9e8de9841cd6ef0f0be086286fcc9ff8f16fd /module/os/linux/zfs/zvol_os.c | |
parent | 808084825492721571d617e6c670dcf307ddffcd (diff) |
zvol_write() can use dmu_tx_hold_write_by_dnode()
We can improve the performance of writes to zvols by using
dmu_tx_hold_write_by_dnode() instead of dmu_tx_hold_write(). This
reduces lock contention on the first block of the dnode object, and also
reduces the amount of CPU needed. The benefit will be highest with
multi-threaded async writes (i.e. writes that don't call zil_commit()).
Reviewed-by: Jorgen Lundman <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Signed-off-by: Matthew Ahrens <[email protected]>
Closes #10184
Diffstat (limited to 'module/os/linux/zfs/zvol_os.c')
-rw-r--r-- | module/os/linux/zfs/zvol_os.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c index fe45d76a6..286c39d5c 100644 --- a/module/os/linux/zfs/zvol_os.c +++ b/module/os/linux/zfs/zvol_os.c @@ -143,7 +143,7 @@ zvol_write(void *arg) if (bytes > volsize - off) /* don't write past the end */ bytes = volsize - off; - dmu_tx_hold_write(tx, ZVOL_OBJ, off, bytes); + dmu_tx_hold_write_by_dnode(tx, zv->zv_dn, off, bytes); /* This will only fail for ENOSPC */ error = dmu_tx_assign(tx, TXG_WAIT); |