Skip to content

Commit 83b0967

Browse files
amotinbehlendorf
authored andcommitted
Do not request data L1 buffers on scan prefetch.
Set ARC_FLAG_NO_BUF when prefetching data L1 buffers for scan. We do not prefetch data L0 buffers, so we do not need the L1 buffers, only want them to be ready in ARC. This saves some CPU time on the buffers decompression. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #15029
1 parent 73ba5df commit 83b0967

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

module/zfs/dsl_scan.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,10 +2080,16 @@ dsl_scan_prefetch_thread(void *arg)
20802080
zio_flags |= ZIO_FLAG_RAW;
20812081
}
20822082

2083+
/* We don't need data L1 buffer since we do not prefetch L0. */
2084+
blkptr_t *bp = &spic->spic_bp;
2085+
if (BP_GET_LEVEL(bp) == 1 && BP_GET_TYPE(bp) != DMU_OT_DNODE &&
2086+
BP_GET_TYPE(bp) != DMU_OT_OBJSET)
2087+
flags |= ARC_FLAG_NO_BUF;
2088+
20832089
/* issue the prefetch asynchronously */
2084-
(void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa,
2085-
&spic->spic_bp, dsl_scan_prefetch_cb, spic->spic_spc,
2086-
ZIO_PRIORITY_SCRUB, zio_flags, &flags, &spic->spic_zb);
2090+
(void) arc_read(scn->scn_zio_root, spa, bp,
2091+
dsl_scan_prefetch_cb, spic->spic_spc, ZIO_PRIORITY_SCRUB,
2092+
zio_flags, &flags, &spic->spic_zb);
20872093

20882094
kmem_free(spic, sizeof (scan_prefetch_issue_ctx_t));
20892095
}

0 commit comments

Comments
 (0)