Make rewrite use Uncached I/O

Rewrite is a one-time/rare bulk administrative operation, which
should minimally affect payload caching.  Plus some avoided memory
copies in its data path allow to significantly increase its speed.

My tests show reduction of time to rewrite 28GB of uncompressed
files on NVMe pool from 17 to 9 seconds and minimal ARC usage.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #17407
This commit is contained in:
Alexander Motin 2025-05-30 21:13:49 -04:00 committed by GitHub
parent f03f9c9bde
commit 2d33c8edb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1178,7 +1178,7 @@ zfs_rewrite(znode_t *zp, uint64_t off, uint64_t len, uint64_t flags,
dmu_buf_t **dbp;
int numbufs;
error = dmu_buf_hold_array_by_dnode(dn, off, n, TRUE, FTAG,
&numbufs, &dbp, DMU_READ_PREFETCH);
&numbufs, &dbp, DMU_READ_PREFETCH | DMU_UNCACHEDIO);
if (error) {
dmu_tx_abort(tx);
break;