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 <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15029
This commit is contained in:
Alexander Motin 2023-07-20 12:10:04 -04:00 committed by GitHub
parent 74f8ce4ca5
commit 7d0df5422c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -2080,10 +2080,16 @@ dsl_scan_prefetch_thread(void *arg)
zio_flags |= ZIO_FLAG_RAW; zio_flags |= ZIO_FLAG_RAW;
} }
/* We don't need data L1 buffer since we do not prefetch L0. */
blkptr_t *bp = &spic->spic_bp;
if (BP_GET_LEVEL(bp) == 1 && BP_GET_TYPE(bp) != DMU_OT_DNODE &&
BP_GET_TYPE(bp) != DMU_OT_OBJSET)
flags |= ARC_FLAG_NO_BUF;
/* issue the prefetch asynchronously */ /* issue the prefetch asynchronously */
(void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, (void) arc_read(scn->scn_zio_root, spa, bp,
&spic->spic_bp, dsl_scan_prefetch_cb, spic->spic_spc, dsl_scan_prefetch_cb, spic->spic_spc, ZIO_PRIORITY_SCRUB,
ZIO_PRIORITY_SCRUB, zio_flags, &flags, &spic->spic_zb); zio_flags, &flags, &spic->spic_zb);
kmem_free(spic, sizeof (scan_prefetch_issue_ctx_t)); kmem_free(spic, sizeof (scan_prefetch_issue_ctx_t));
} }