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 <[email protected]>
Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
Closes #17407
This commit is contained in:
Alexander Motin authored and GitHub committed 2025-05-30 21:13:49 -04:00
1 parent f03f9c9bde
commit 2d33c8edb6
1 file changed
+1 -1
+1 -1
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;