Skip to content

Commit

Permalink
ztest: periodically start/stop log spacemap flush
Browse files Browse the repository at this point in the history
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>
  • Loading branch information
robn committed Nov 13, 2024
1 parent 963af68 commit 94b1364
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion cmd/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2017 Joyent, Inc.
* Copyright (c) 2017, Intel Corporation.
* Copyright (c) 2023, Klara, Inc.
* Copyright (c) 2023, 2024, Klara, Inc.
*/

/*
Expand Down Expand Up @@ -449,6 +449,8 @@ ztest_func_t ztest_fletcher_incr;
ztest_func_t ztest_verify_dnode_bt;
ztest_func_t ztest_pool_prefetch_ddt;
ztest_func_t ztest_ddt_prune;
ztest_func_t ztest_spa_log_flushall_start;
ztest_func_t ztest_spa_log_flushall_cancel;

static uint64_t zopt_always = 0ULL * NANOSEC; /* all the time */
static uint64_t zopt_incessant = 1ULL * NANOSEC / 10; /* every 1/10 second */
Expand Down Expand Up @@ -506,6 +508,8 @@ static ztest_info_t ztest_info[] = {
ZTI_INIT(ztest_verify_dnode_bt, 1, &zopt_sometimes),
ZTI_INIT(ztest_pool_prefetch_ddt, 1, &zopt_rarely),
ZTI_INIT(ztest_ddt_prune, 1, &zopt_rarely),
ZTI_INIT(ztest_spa_log_flushall_start, 1, &zopt_rarely),
ZTI_INIT(ztest_spa_log_flushall_cancel, 1, &zopt_rarely),
};

#define ZTEST_FUNCS (sizeof (ztest_info) / sizeof (ztest_info_t))
Expand Down Expand Up @@ -6217,6 +6221,20 @@ ztest_verify_dnode_bt(ztest_ds_t *zd, uint64_t id)
}
}

void
ztest_spa_log_flushall_start(ztest_ds_t *zd, uint64_t id)
{
(void) zd, (void) id;
spa_log_flushall_start(ztest_spa, SPA_LOG_FLUSHALL_REQUEST, 0);
}

void
ztest_spa_log_flushall_cancel(ztest_ds_t *zd, uint64_t id)
{
(void) zd, (void) id;
spa_log_flushall_cancel(ztest_spa);
}

void
ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id)
{
Expand Down

0 comments on commit 94b1364

Please sign in to comment.