-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add knob to disable slow io notifications #17477
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
Open
oshogbo
wants to merge
1
commit into
openzfs:master
Choose a base branch
from
oshogbo:oshogbo/n_knob
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -427,32 +427,53 @@ vdev_get_nparity(vdev_t *vd) | |
} | ||
|
||
static int | ||
vdev_prop_get_int(vdev_t *vd, vdev_prop_t prop, uint64_t *value) | ||
vdev_prop_get_objid(vdev_t *vd, uint64_t *objid) | ||
{ | ||
spa_t *spa = vd->vdev_spa; | ||
objset_t *mos = spa->spa_meta_objset; | ||
uint64_t objid; | ||
int err; | ||
|
||
if (vd->vdev_root_zap != 0) { | ||
objid = vd->vdev_root_zap; | ||
*objid = vd->vdev_root_zap; | ||
} else if (vd->vdev_top_zap != 0) { | ||
objid = vd->vdev_top_zap; | ||
*objid = vd->vdev_top_zap; | ||
} else if (vd->vdev_leaf_zap != 0) { | ||
objid = vd->vdev_leaf_zap; | ||
*objid = vd->vdev_leaf_zap; | ||
} else { | ||
return (EINVAL); | ||
} | ||
|
||
return (0); | ||
} | ||
|
||
static int | ||
vdev_prop_get_int(vdev_t *vd, vdev_prop_t prop, uint64_t *value) | ||
{ | ||
spa_t *spa = vd->vdev_spa; | ||
objset_t *mos = spa->spa_meta_objset; | ||
uint64_t objid; | ||
int err; | ||
|
||
if (vdev_prop_get_objid(vd, &objid) != 0) | ||
return (EINVAL); | ||
|
||
err = zap_lookup(mos, objid, vdev_prop_to_name(prop), | ||
sizeof (uint64_t), 1, value); | ||
|
||
if (err == ENOENT) | ||
*value = vdev_prop_default_numeric(prop); | ||
|
||
return (err); | ||
} | ||
|
||
static int | ||
vdev_prop_get_bool(vdev_t *vd, vdev_prop_t prop, boolean_t *bvalue) | ||
{ | ||
int err; | ||
uint64_t ivalue; | ||
|
||
err = vdev_prop_get_int(vd, prop, &ivalue); | ||
*bvalue = ivalue & 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be |
||
|
||
return (err); | ||
} | ||
|
||
/* | ||
* Get the number of data disks for a top-level vdev. | ||
*/ | ||
|
@@ -713,8 +734,12 @@ vdev_alloc_common(spa_t *spa, uint_t id, uint64_t guid, vdev_ops_t *ops) | |
*/ | ||
vd->vdev_checksum_n = vdev_prop_default_numeric(VDEV_PROP_CHECKSUM_N); | ||
vd->vdev_checksum_t = vdev_prop_default_numeric(VDEV_PROP_CHECKSUM_T); | ||
|
||
vd->vdev_io_n = vdev_prop_default_numeric(VDEV_PROP_IO_N); | ||
vd->vdev_io_t = vdev_prop_default_numeric(VDEV_PROP_IO_T); | ||
|
||
vd->vdev_slow_io_reporting = vdev_prop_default_numeric( | ||
VDEV_PROP_SLOW_IO_REPORTING); | ||
vd->vdev_slow_io_n = vdev_prop_default_numeric(VDEV_PROP_SLOW_IO_N); | ||
vd->vdev_slow_io_t = vdev_prop_default_numeric(VDEV_PROP_SLOW_IO_T); | ||
|
||
|
@@ -3852,6 +3877,11 @@ vdev_load(vdev_t *vd) | |
vdev_dbgmsg(vd, "vdev_load: zap_lookup(zap=%llu) " | ||
"failed [error=%d]", (u_longlong_t)zapobj, error); | ||
|
||
error = vdev_prop_get_bool(vd, VDEV_PROP_SLOW_IO_REPORTING, | ||
&vd->vdev_slow_io_reporting); | ||
if (error && error != ENOENT) | ||
vdev_dbgmsg(vd, "vdev_load: zap_lookup(zap=%llu) " | ||
"failed [error=%d]", (u_longlong_t)zapobj, error); | ||
error = vdev_prop_get_int(vd, VDEV_PROP_SLOW_IO_N, | ||
&vd->vdev_slow_io_n); | ||
if (error && error != ENOENT) | ||
|
@@ -5899,15 +5929,8 @@ vdev_props_set_sync(void *arg, dmu_tx_t *tx) | |
/* | ||
* Set vdev property values in the vdev props mos object. | ||
*/ | ||
if (vd->vdev_root_zap != 0) { | ||
objid = vd->vdev_root_zap; | ||
} else if (vd->vdev_top_zap != 0) { | ||
objid = vd->vdev_top_zap; | ||
} else if (vd->vdev_leaf_zap != 0) { | ||
objid = vd->vdev_leaf_zap; | ||
} else { | ||
if (vdev_prop_get_objid(vd, &objid) != 0) | ||
panic("unexpected vdev type"); | ||
} | ||
|
||
mutex_enter(&spa->spa_props_lock); | ||
|
||
|
@@ -6084,6 +6107,13 @@ vdev_prop_set(vdev_t *vd, nvlist_t *innvl, nvlist_t *outnvl) | |
} | ||
vd->vdev_io_t = intval; | ||
break; | ||
case VDEV_PROP_SLOW_IO_REPORTING: | ||
if (nvpair_value_uint64(elem, &intval) != 0) { | ||
error = EINVAL; | ||
break; | ||
} | ||
vd->vdev_slow_io_reporting = intval & 1; | ||
break; | ||
case VDEV_PROP_SLOW_IO_N: | ||
if (nvpair_value_uint64(elem, &intval) != 0) { | ||
error = EINVAL; | ||
|
@@ -6125,6 +6155,7 @@ vdev_prop_get(vdev_t *vd, nvlist_t *innvl, nvlist_t *outnvl) | |
nvpair_t *elem = NULL; | ||
nvlist_t *nvprops = NULL; | ||
uint64_t intval = 0; | ||
boolean_t boolval = 0; | ||
char *strval = NULL; | ||
const char *propname = NULL; | ||
vdev_prop_t prop; | ||
|
@@ -6138,15 +6169,8 @@ vdev_prop_get(vdev_t *vd, nvlist_t *innvl, nvlist_t *outnvl) | |
|
||
nvlist_lookup_nvlist(innvl, ZPOOL_VDEV_PROPS_GET_PROPS, &nvprops); | ||
|
||
if (vd->vdev_root_zap != 0) { | ||
objid = vd->vdev_root_zap; | ||
} else if (vd->vdev_top_zap != 0) { | ||
objid = vd->vdev_top_zap; | ||
} else if (vd->vdev_leaf_zap != 0) { | ||
objid = vd->vdev_leaf_zap; | ||
} else { | ||
if (vdev_prop_get_objid(vd, &objid) != 0) | ||
return (SET_ERROR(EINVAL)); | ||
} | ||
ASSERT(objid != 0); | ||
|
||
mutex_enter(&spa->spa_props_lock); | ||
|
@@ -6455,6 +6479,18 @@ vdev_prop_get(vdev_t *vd, nvlist_t *innvl, nvlist_t *outnvl) | |
vdev_prop_add_list(outnvl, propname, strval, | ||
intval, src); | ||
break; | ||
case VDEV_PROP_SLOW_IO_REPORTING: | ||
err = vdev_prop_get_bool(vd, prop, &boolval); | ||
if (err && err != ENOENT) | ||
break; | ||
|
||
src = ZPROP_SRC_LOCAL; | ||
if (boolval == vdev_prop_default_numeric(prop)) | ||
src = ZPROP_SRC_DEFAULT; | ||
|
||
vdev_prop_add_list(outnvl, propname, NULL, | ||
boolval, src); | ||
break; | ||
case VDEV_PROP_CHECKSUM_N: | ||
case VDEV_PROP_CHECKSUM_T: | ||
case VDEV_PROP_IO_N: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ typeset -a properties=( | |
checksum_t | ||
io_n | ||
io_t | ||
slow_io_reporting | ||
slow_io_n | ||
slow_io_t | ||
trim_support | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should here and below be
slow_io_reporting
instead ofslow_io_downgrade
?