BRT: Skip duplicate BRT prefetches

If there is a pending entry for this block, then we've already
issued BRT prefetch for it within this TXG, so don't do it again.
BRT vdev lookup and following zap_prefetch_uint64() call can be
pretty expensive and should be avoided when not necessary.

Reviewed-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15941
This commit is contained in:
Alexander Motin 2024-03-25 17:58:04 -04:00 committed by GitHub
parent 102b468b5e
commit bf8f72359d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -1472,11 +1472,11 @@ brt_pending_add(spa_t *spa, const blkptr_t *bp, dmu_tx_t *tx)
kmem_cache_free(brt_pending_entry_cache, newbpe); kmem_cache_free(brt_pending_entry_cache, newbpe);
} else { } else {
ASSERT(bpe == NULL); ASSERT(bpe == NULL);
}
/* Prefetch BRT entry, as we will need it in the syncing context. */ /* Prefetch BRT entry for the syncing context. */
brt_prefetch(brt, bp); brt_prefetch(brt, bp);
} }
}
void void
brt_pending_remove(spa_t *spa, const blkptr_t *bp, dmu_tx_t *tx) brt_pending_remove(spa_t *spa, const blkptr_t *bp, dmu_tx_t *tx)