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.

Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
This commit is contained in:
Alexander Motin 2024-02-28 16:28:12 -05:00
parent 8f2f6cd2ac
commit 74fc769ffd
1 changed files with 3 additions and 3 deletions

View File

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