DDT: Add/use zap_lookup_length_uint64_by_dnode()

Unlike other ZAP consumers due to compression DDT does not know
how big entry it is reading from ZAP.  Due to this it called
zap_length_uint64_by_dnode() and zap_lookup_uint64_by_dnode(),
each of which does full ZAP entry lookup.

Introduction of the combined ZAP method dramatically reduces the
CPU overhead and locks contention at DBUF layer.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #18048
This commit is contained in:
Alexander Motin
2025-12-15 17:38:34 -05:00
committed by Tony Hutter
parent 4905686e67
commit 4ab2027f59
5 changed files with 46 additions and 26 deletions
+2 -1
View File
@@ -219,7 +219,8 @@ void fzap_byteswap(void *buf, size_t size);
int fzap_count(zap_t *zap, uint64_t *count);
int fzap_lookup(zap_name_t *zn,
uint64_t integer_size, uint64_t num_integers, void *buf,
char *realname, int rn_len, boolean_t *normalization_conflictp);
char *realname, int rn_len, boolean_t *normalization_conflictp,
uint64_t *actual_num_integers);
void fzap_prefetch(zap_name_t *zn);
int fzap_add(zap_name_t *zn, uint64_t integer_size, uint64_t num_integers,
const void *val, const void *tag, dmu_tx_t *tx);