diff options
author | Rob Norris <[email protected]> | 2023-07-03 19:54:40 +1000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2024-08-16 12:02:31 -0700 |
commit | 0ba5f503c5d644d28429c366fd1cdbd1c6c9b2b9 (patch) | |
tree | 09de0646fb80bd033fadd64c5b96b5ac9a476f6b /include/sys | |
parent | 4d686c3da53db5e5f3f3cc52060d9fbca2baf092 (diff) |
ddt: slim down ddt_entry_t
This slims down the in-memory entry to as small as it can be. The
IO-related parts are made into a separate entry, since they're
relatively rarely needed.
The variable allocation for dde_phys is to support the upcoming flat
format.
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: Klara, Inc.
Sponsored-by: iXsystems, Inc.
Closes #15893
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/ddt.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/sys/ddt.h b/include/sys/ddt.h index 7a0916690..222373c98 100644 --- a/include/sys/ddt.h +++ b/include/sys/ddt.h @@ -151,16 +151,22 @@ typedef struct { #define DDE_FLAG_LOADED (1 << 0) /* entry ready for use */ #define DDE_FLAG_OVERQUOTA (1 << 1) /* entry unusable, no space */ +/* + * Additional data to support entry update or repair. This is fixed size + * because its relatively rarely used. + */ typedef struct { - /* key must be first for ddt_key_compare */ - ddt_key_t dde_key; /* ddt_tree key */ - ddt_phys_t dde_phys[DDT_PHYS_MAX]; /* on-disk data */ + /* copy of data after a repair read, to be rewritten */ + abd_t *dde_repair_abd; /* in-flight update IOs */ zio_t *dde_lead_zio[DDT_PHYS_MAX]; +} ddt_entry_io_t; - /* copy of data after a repair read, to be rewritten */ - struct abd *dde_repair_abd; +typedef struct { + /* key must be first for ddt_key_compare */ + ddt_key_t dde_key; /* ddt_tree key */ + avl_node_t dde_node; /* ddt_tree_node */ /* storage type and class the entry was loaded from */ ddt_type_t dde_type; @@ -170,7 +176,9 @@ typedef struct { kcondvar_t dde_cv; /* signaled when load completes */ uint64_t dde_waiters; /* count of waiters on dde_cv */ - avl_node_t dde_node; /* ddt_tree node */ + ddt_entry_io_t *dde_io; /* IO support, when required */ + + ddt_phys_t dde_phys[]; /* physical data */ } ddt_entry_t; /* @@ -265,6 +273,8 @@ extern void ddt_prefetch_all(spa_t *spa); extern boolean_t ddt_class_contains(spa_t *spa, ddt_class_t max_class, const blkptr_t *bp); +extern void ddt_alloc_entry_io(ddt_entry_t *dde); + extern ddt_entry_t *ddt_repair_start(ddt_t *ddt, const blkptr_t *bp); extern void ddt_repair_done(ddt_t *ddt, ddt_entry_t *dde); |