Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasabi 215p11 #1

Merged
merged 32 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
40b2b48
Consider `dnode_t` allocations in dbuf cache size accounting
robn Nov 17, 2023
671c597
linux 5.4 compat: page_size()
robn Nov 13, 2023
edf4cf0
abd: add page iterator
robn Dec 11, 2023
d00ab54
vdev_disk: rename existing functions to vdev_classic_*
robn Jan 9, 2024
1feddf1
vdev_disk: reorganise vdev_disk_io_start
robn Jan 9, 2024
21f6808
vdev_disk: make read/write IO function configurable
robn Jan 9, 2024
1b16b90
vdev_disk: rewrite BIO filling machinery to avoid split pages
robn Jul 18, 2023
ba6d0fb
vdev_disk: add module parameter to select BIO submission method
robn Jan 9, 2024
ce57195
vdev_disk: use bio_chain() to submit multiple BIOs
robn Feb 21, 2024
9e1afd0
abd_iter_page: don't use compound heads on Linux <4.5
robn Mar 13, 2024
657c1f7
vdev_disk: don't touch vbio after its handed off to the kernel
robn Apr 2, 2024
1339b7e
spa: make read/write queues configurable
robn Oct 25, 2023
c3b78e7
freebsd: fix compile for spa_taskq_read/spa_taskq_write params
robn Jan 11, 2024
92063ad
spa: Fix FreeBSD sysctl handlers
markjdb Dec 29, 2023
79d0929
spa: Let spa_taskq_param_get()'s addition of a newline be optional
markjdb Dec 29, 2023
238392b
FreeBSD: catch up to __FreeBSD_version 1400093
mjguzik Jul 13, 2023
2fec57b
trace: spa_taskqs_ent trace class, dispatch and dispatched tracepoints
robn Oct 23, 2023
c85d31a
taskq: add taskq_try_dispatch_ent()
robn Oct 23, 2023
7d74fc7
spa_taskq_dispatch_ent: look for an unlocked taskq before waiting
robn Oct 23, 2023
4e9cbd0
spa: add zio_taskq_trylock tuneable
robn Dec 22, 2023
014ff86
slack: fix decompression
robn Jan 12, 2024
831fdad
slack: require module param before enabling slack compression
robn Jan 15, 2024
bef9815
tests: add tests for zpool import behaviour when hostid changes
robn Sep 18, 2023
0ab4172
import: require force when cachefile hostid doesn't match on-disk
robn Sep 16, 2023
4296626
Extend import_progress kstat with a notes field
Dec 5, 2023
dbf9aed
Parallel pool import
grwilson Apr 22, 2024
f2d25f5
vdev probe to slow disk can stall mmp write checker
Apr 29, 2024
006d506
status: report pool suspension state under failmode=continue
robn Sep 20, 2023
6b9de04
vdev_disk: fix alignment check when buffer has non-zero starting offset
robn Apr 10, 2024
f20ad6f
zil_commit_impl: don't assert ZIL is not suspended
robn Apr 15, 2024
4319de2
tests: l2arc_arcstats_pos: Add a timeout
0mp Apr 19, 2024
ce2a365
Add support for parallel pool exports
don-brady May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions cmd/dbufstat/dbufstat.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import re

bhdr = ["pool", "objset", "object", "level", "blkid", "offset", "dbsize"]
bxhdr = ["pool", "objset", "object", "level", "blkid", "offset", "dbsize",
"meta", "state", "dbholds", "dbc", "list", "atype", "flags",
"usize", "meta", "state", "dbholds", "dbc", "list", "atype", "flags",
"count", "asize", "access", "mru", "gmru", "mfu", "gmfu", "l2",
"l2_dattr", "l2_asize", "l2_comp", "aholds", "dtype", "btype",
"data_bs", "meta_bs", "bsize", "lvls", "dholds", "blocks", "dsize"]
Expand All @@ -47,17 +47,17 @@ dhdr = ["pool", "objset", "object", "dtype", "cached"]
dxhdr = ["pool", "objset", "object", "dtype", "btype", "data_bs", "meta_bs",
"bsize", "lvls", "dholds", "blocks", "dsize", "cached", "direct",
"indirect", "bonus", "spill"]
dincompat = ["level", "blkid", "offset", "dbsize", "meta", "state", "dbholds",
"dbc", "list", "atype", "flags", "count", "asize", "access",
"mru", "gmru", "mfu", "gmfu", "l2", "l2_dattr", "l2_asize",
"l2_comp", "aholds"]
dincompat = ["level", "blkid", "offset", "dbsize", "usize", "meta", "state",
"dbholds", "dbc", "list", "atype", "flags", "count", "asize",
"access", "mru", "gmru", "mfu", "gmfu", "l2", "l2_dattr",
"l2_asize", "l2_comp", "aholds"]

thdr = ["pool", "objset", "dtype", "cached"]
txhdr = ["pool", "objset", "dtype", "cached", "direct", "indirect",
"bonus", "spill"]
tincompat = ["object", "level", "blkid", "offset", "dbsize", "meta", "state",
"dbc", "dbholds", "list", "atype", "flags", "count", "asize",
"access", "mru", "gmru", "mfu", "gmfu", "l2", "l2_dattr",
tincompat = ["object", "level", "blkid", "offset", "dbsize", "usize", "meta",
"state", "dbc", "dbholds", "list", "atype", "flags", "count",
"asize", "access", "mru", "gmru", "mfu", "gmfu", "l2", "l2_dattr",
"l2_asize", "l2_comp", "aholds", "btype", "data_bs", "meta_bs",
"bsize", "lvls", "dholds", "blocks", "dsize"]

Expand All @@ -70,6 +70,7 @@ cols = {
"blkid": [8, -1, "block number of buffer"],
"offset": [12, 1024, "offset in object of buffer"],
"dbsize": [7, 1024, "size of buffer"],
"usize": [7, 1024, "size of attached user data"],
"meta": [4, -1, "is this buffer metadata?"],
"state": [5, -1, "state of buffer (read, cached, etc)"],
"dbholds": [7, 1000, "number of holds on buffer"],
Expand Down Expand Up @@ -399,6 +400,7 @@ def update_dict(d, k, line, labels):
key = line[labels[k]]

dbsize = int(line[labels['dbsize']])
usize = int(line[labels['usize']])
blkid = int(line[labels['blkid']])
level = int(line[labels['level']])

Expand All @@ -416,7 +418,7 @@ def update_dict(d, k, line, labels):
d[pool][objset][key]['indirect'] = 0
d[pool][objset][key]['spill'] = 0

d[pool][objset][key]['cached'] += dbsize
d[pool][objset][key]['cached'] += dbsize + usize

if blkid == -1:
d[pool][objset][key]['bonus'] += dbsize
Expand Down
114 changes: 106 additions & 8 deletions cmd/zinject/zinject.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
* Copyright (c) 2017, Intel Corporation.
* Copyright (c) 2023-2024, Klara Inc.
*/

/*
Expand Down Expand Up @@ -276,6 +277,11 @@ usage(void)
"\t\tcreate 3 lanes on the device; one lane with a latency\n"
"\t\tof 10 ms and two lanes with a 25 ms latency.\n"
"\n"
"\tzinject -P import|export -s <seconds> pool\n"
"\t\tAdd an artificial delay to a future pool import or export,\n"
"\t\tsuch that the operation takes a minimum of supplied seconds\n"
"\t\tto complete.\n"
"\n"
"\tzinject -I [-s <seconds> | -g <txgs>] pool\n"
"\t\tCause the pool to stop writing blocks yet not\n"
"\t\treport errors for a duration. Simulates buggy hardware\n"
Expand Down Expand Up @@ -358,8 +364,10 @@ print_data_handler(int id, const char *pool, zinject_record_t *record,
{
int *count = data;

if (record->zi_guid != 0 || record->zi_func[0] != '\0')
if (record->zi_guid != 0 || record->zi_func[0] != '\0' ||
record->zi_duration != 0) {
return (0);
}

if (*count == 0) {
(void) printf("%3s %-15s %-6s %-6s %-8s %3s %-4s "
Expand Down Expand Up @@ -462,6 +470,33 @@ print_panic_handler(int id, const char *pool, zinject_record_t *record,
return (0);
}

static int
print_pool_delay_handler(int id, const char *pool, zinject_record_t *record,
void *data)
{
int *count = data;

if (record->zi_cmd != ZINJECT_DELAY_IMPORT &&
record->zi_cmd != ZINJECT_DELAY_EXPORT) {
return (0);
}

if (*count == 0) {
(void) printf("%3s %-19s %-11s %s\n",
"ID", "POOL", "DELAY (sec)", "COMMAND");
(void) printf("--- ------------------- -----------"
" -------\n");
}

*count += 1;

(void) printf("%3d %-19s %-11llu %s\n",
id, pool, (u_longlong_t)record->zi_duration,
record->zi_cmd == ZINJECT_DELAY_IMPORT ? "import": "export");

return (0);
}

/*
* Print all registered error handlers. Returns the number of handlers
* registered.
Expand Down Expand Up @@ -492,6 +527,13 @@ print_all_handlers(void)
count = 0;
}

(void) iter_handlers(print_pool_delay_handler, &count);
if (count > 0) {
total += count;
(void) printf("\n");
count = 0;
}

(void) iter_handlers(print_panic_handler, &count);

return (count + total);
Expand Down Expand Up @@ -564,9 +606,27 @@ register_handler(const char *pool, int flags, zinject_record_t *record,
zc.zc_guid = flags;

if (zfs_ioctl(g_zfs, ZFS_IOC_INJECT_FAULT, &zc) != 0) {
(void) fprintf(stderr, "failed to add handler: %s\n",
errno == EDOM ? "block level exceeds max level of object" :
strerror(errno));
const char *errmsg = strerror(errno);

switch (errno) {
case EDOM:
errmsg = "block level exceeds max level of object";
break;
case EEXIST:
if (record->zi_cmd == ZINJECT_DELAY_IMPORT)
errmsg = "pool already imported";
if (record->zi_cmd == ZINJECT_DELAY_EXPORT)
errmsg = "a handler already exists";
break;
case ENOENT:
/* import delay injector running on older zfs module */
if (record->zi_cmd == ZINJECT_DELAY_IMPORT)
errmsg = "import delay injector not supported";
break;
default:
break;
}
(void) fprintf(stderr, "failed to add handler: %s\n", errmsg);
return (1);
}

Expand All @@ -591,6 +651,9 @@ register_handler(const char *pool, int flags, zinject_record_t *record,
} else if (record->zi_duration < 0) {
(void) printf(" txgs: %lld \n",
(u_longlong_t)-record->zi_duration);
} else if (record->zi_timer > 0) {
(void) printf(" timer: %lld ms\n",
(u_longlong_t)NSEC2MSEC(record->zi_timer));
} else {
(void) printf("objset: %llu\n",
(u_longlong_t)record->zi_objset);
Expand Down Expand Up @@ -789,7 +852,7 @@ main(int argc, char **argv)
}

while ((c = getopt(argc, argv,
":aA:b:C:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) {
":aA:b:C:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:P:")) != -1) {
switch (c) {
case 'a':
flags |= ZINJECT_FLUSH_ARC;
Expand Down Expand Up @@ -919,6 +982,19 @@ main(int argc, char **argv)
sizeof (record.zi_func));
record.zi_cmd = ZINJECT_PANIC;
break;
case 'P':
if (strcasecmp(optarg, "import") == 0) {
record.zi_cmd = ZINJECT_DELAY_IMPORT;
} else if (strcasecmp(optarg, "export") == 0) {
record.zi_cmd = ZINJECT_DELAY_EXPORT;
} else {
(void) fprintf(stderr, "invalid command '%s': "
"must be 'import' or 'export'\n", optarg);
usage();
libzfs_fini(g_zfs);
return (1);
}
break;
case 'q':
quiet = 1;
break;
Expand Down Expand Up @@ -998,7 +1074,7 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;

if (record.zi_duration != 0)
if (record.zi_duration != 0 && record.zi_cmd == 0)
record.zi_cmd = ZINJECT_IGNORED_WRITES;

if (cancel != NULL) {
Expand Down Expand Up @@ -1128,8 +1204,8 @@ main(int argc, char **argv)
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
level != 0 || device != NULL || record.zi_freq > 0 ||
dvas != 0) {
(void) fprintf(stderr, "panic (-p) incompatible with "
"other options\n");
(void) fprintf(stderr, "%s incompatible with other "
"options\n", "import|export delay (-P)");
usage();
libzfs_fini(g_zfs);
return (2);
Expand All @@ -1147,6 +1223,28 @@ main(int argc, char **argv)
if (argv[1] != NULL)
record.zi_type = atoi(argv[1]);
dataset[0] = '\0';
} else if (record.zi_cmd == ZINJECT_DELAY_IMPORT ||
record.zi_cmd == ZINJECT_DELAY_EXPORT) {
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
level != 0 || device != NULL || record.zi_freq > 0 ||
dvas != 0) {
(void) fprintf(stderr, "%s incompatible with other "
"options\n", "import|export delay (-P)");
usage();
libzfs_fini(g_zfs);
return (2);
}

if (argc != 1 || record.zi_duration <= 0) {
(void) fprintf(stderr, "import|export delay (-P) "
"injection requires a duration (-s) and a single "
"pool name\n");
usage();
libzfs_fini(g_zfs);
return (2);
}

(void) strlcpy(pool, argv[0], sizeof (pool));
} else if (record.zi_cmd == ZINJECT_IGNORED_WRITES) {
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
level != 0 || record.zi_freq > 0 || dvas != 0) {
Expand Down
Loading
Loading