Skip to content

Commit

Permalink
BRT: Skip duplicate BRT prefetches
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
Closes #15941
  • Loading branch information
amotin authored and behlendorf committed Apr 19, 2024
1 parent dced953 commit fdd8c0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/zfs/brt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,10 +1472,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
Expand Down

0 comments on commit fdd8c0a

Please sign in to comment.