]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ZIL: Avoid dbuf_read() before dmu_sync().
authorAlexander Motin <mav@FreeBSD.org>
Fri, 11 Aug 2023 16:04:08 +0000 (12:04 -0400)
committerGitHub <noreply@github.com>
Fri, 11 Aug 2023 16:04:08 +0000 (09:04 -0700)
commitbdb7df42451836f629e725de74b4edbc5e16ff49
treeebc9b7bf17c5b96ff41034a6cb03f2984fdc7ed9
parent8ce2eba9e6a384feef93d77c397f37d17dc588ce
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
include/sys/dmu.h
include/sys/dmu_impl.h
module/zfs/dmu.c
module/zfs/zfs_vnops.c
module/zfs/zvol.c