forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dm thin: add 'no_space_timeout' dm-thin-pool module param
Commit 85ad643 ("dm thin: add timeout to stop out-of-data-space mode holding IO forever") introduced a fixed 60 second timeout. Users may want to either disable or modify this timeout. Allow the out-of-data-space timeout to be configured using the 'no_space_timeout' dm-thin-pool module param. Setting it to 0 will disable the timeout, resulting in IO being queued until more data space is added to the thin-pool. Signed-off-by: Mike Snitzer <[email protected]> Cc: [email protected] # 3.14+
- Loading branch information
Showing
2 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -27,7 +27,9 @@ | |
#define MAPPING_POOL_SIZE 1024 | ||
#define PRISON_CELLS 1024 | ||
#define COMMIT_PERIOD HZ | ||
#define NO_SPACE_TIMEOUT (HZ * 60) | ||
#define NO_SPACE_TIMEOUT_SECS 60 | ||
|
||
static unsigned no_space_timeout_secs = NO_SPACE_TIMEOUT_SECS; | ||
|
||
DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(snapshot_copy_throttle, | ||
"A percentage of time allocated for copy on write"); | ||
|
@@ -1670,6 +1672,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) | |
struct pool_c *pt = pool->ti->private; | ||
bool needs_check = dm_pool_metadata_needs_check(pool->pmd); | ||
enum pool_mode old_mode = get_pool_mode(pool); | ||
unsigned long no_space_timeout = ACCESS_ONCE(no_space_timeout_secs) * HZ; | ||
|
||
/* | ||
* Never allow the pool to transition to PM_WRITE mode if user | ||
|
@@ -1732,8 +1735,8 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) | |
pool->process_prepared_mapping = process_prepared_mapping; | ||
pool->process_prepared_discard = process_prepared_discard_passdown; | ||
|
||
if (!pool->pf.error_if_no_space) | ||
queue_delayed_work(pool->wq, &pool->no_space_timeout, NO_SPACE_TIMEOUT); | ||
if (!pool->pf.error_if_no_space && no_space_timeout) | ||
queue_delayed_work(pool->wq, &pool->no_space_timeout, no_space_timeout); | ||
break; | ||
|
||
case PM_WRITE: | ||
|
@@ -3508,6 +3511,9 @@ static void dm_thin_exit(void) | |
module_init(dm_thin_init); | ||
module_exit(dm_thin_exit); | ||
|
||
module_param_named(no_space_timeout, no_space_timeout_secs, uint, S_IRUGO | S_IWUSR); | ||
MODULE_PARM_DESC(no_space_timeout, "Out of data space queue IO timeout in seconds"); | ||
|
||
MODULE_DESCRIPTION(DM_NAME " thin provisioning target"); | ||
MODULE_AUTHOR("Joe Thornber <[email protected]>"); | ||
MODULE_LICENSE("GPL"); |