ddt: add support for prefetching tables into the ARC

This change adds a new `zpool prefetch -t ddt $pool` command which
causes a pool's DDT to be loaded into the ARC. The primary goal is to
remove the need to "warm" a pool's cache before deduplication stops
slowing write performance. It may also provide a way to reload portions
of a DDT if they have been flushed due to inactivity.

Sponsored-by: iXsystems, Inc.
Sponsored-by: Catalogics, Inc.
Sponsored-by: Klara, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Will Andrews <will.andrews@klarasystems.com>
Signed-off-by: Fred Weigel <fred.weigel@klarasystems.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Signed-off-by: Don Brady <don.brady@klarasystems.com>
Co-authored-by: Will Andrews <will.andrews@klarasystems.com>
Co-authored-by: Don Brady <don.brady@klarasystems.com>
Closes #15890
This commit is contained in:
Allan Jude
2024-07-26 12:16:18 -04:00
committed by GitHub
parent 2ed1aebaf6
commit 62e7d3c89e
37 changed files with 1067 additions and 52 deletions
+23
View File
@@ -260,6 +260,7 @@ typedef enum {
ZPOOL_PROP_BCLONERATIO,
ZPOOL_PROP_DEDUP_TABLE_SIZE,
ZPOOL_PROP_DEDUP_TABLE_QUOTA,
ZPOOL_PROP_DEDUPCACHED,
ZPOOL_NUM_PROPS
} zpool_prop_t;
@@ -1517,6 +1518,7 @@ typedef enum zfs_ioc {
ZFS_IOC_VDEV_GET_PROPS, /* 0x5a55 */
ZFS_IOC_VDEV_SET_PROPS, /* 0x5a56 */
ZFS_IOC_POOL_SCRUB, /* 0x5a57 */
ZFS_IOC_POOL_PREFETCH, /* 0x5a58 */
/*
* Per-platform (Optional) - 8/128 numbers reserved.
@@ -1648,6 +1650,11 @@ typedef enum {
ZFS_WAIT_NUM_ACTIVITIES
} zfs_wait_activity_t;
typedef enum {
ZPOOL_PREFETCH_NONE = 0,
ZPOOL_PREFETCH_DDT
} zpool_prefetch_type_t;
/*
* Bookmark name values.
*/
@@ -1686,6 +1693,17 @@ typedef enum {
*/
#define ZPOOL_HIDDEN_ARGS "hidden_args"
/*
* The following is used when invoking ZFS_IOC_POOL_GET_PROPS.
*/
#define ZPOOL_GET_PROPS_NAMES "get_props_names"
/*
* Opt-in property names used with ZPOOL_GET_PROPS_NAMES.
* For example, properties that are hidden or expensive to compute.
*/
#define ZPOOL_DEDUPCACHED_PROP_NAME "dedupcached"
/*
* The following are names used when invoking ZFS_IOC_POOL_INITIALIZE.
*/
@@ -1725,6 +1743,11 @@ typedef enum {
#define ZFS_WAIT_ACTIVITY "wait_activity"
#define ZFS_WAIT_WAITED "wait_waited"
/*
* The following are names used when invoking ZFS_IOC_POOL_PREFETCH.
*/
#define ZPOOL_PREFETCH_TYPE "prefetch_type"
/*
* Flags for ZFS_IOC_VDEV_SET_STATE
*/