mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
ZIL: Avoid dbuf_read() before dmu_sync().
In most cases dmu_sync() works with dirty records directly and does not need actual data. The only exception is dmu_sync_late_arrival(). To save some CPU time use dmu_buf_hold_noread*() in z*_get_data() and explicitly call dbuf_read() in dmu_sync_late_arrival(). There is also a chance that by that time TXG will already be synced and we won't have to do it at all. Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #15153
This commit is contained in:
+2
-2
@@ -727,8 +727,8 @@ zvol_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf,
|
||||
offset = P2ALIGN_TYPED(offset, size, uint64_t);
|
||||
zgd->zgd_lr = zfs_rangelock_enter(&zv->zv_rangelock, offset,
|
||||
size, RL_READER);
|
||||
error = dmu_buf_hold_by_dnode(zv->zv_dn, offset, zgd, &db,
|
||||
DMU_READ_NO_PREFETCH);
|
||||
error = dmu_buf_hold_noread_by_dnode(zv->zv_dn, offset, zgd,
|
||||
&db);
|
||||
if (error == 0) {
|
||||
blkptr_t *bp = &lr->lr_blkptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user