Skip to content

Commit d31e0de

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: change default schedule timeout value
This patch changes default schedule timeout value from 20ms to 1ms, in order to give caller more chances to check whether IO or non-IO congestion condition has already been mitigable. In addition, default interval of periodical discard submission is kept to 20ms. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 76e780d commit d31e0de

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

fs/f2fs/f2fs.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ struct discard_entry {
407407
#define DEFAULT_DISCARD_GRANULARITY 16
408408
/* default maximum discard granularity of ordered discard, unit: block count */
409409
#define DEFAULT_MAX_ORDERED_DISCARD_GRANULARITY 16
410+
/* default interval of periodical discard submission */
411+
#define DEFAULT_DISCARD_INTERVAL (msecs_to_jiffies(20))
410412

411413
/* max discard pend list number */
412414
#define MAX_PLIST_NUM 512
@@ -656,8 +658,8 @@ enum {
656658

657659
#define DEFAULT_RETRY_IO_COUNT 8 /* maximum retry read IO or flush count */
658660

659-
/* IO/non-IO congestion wait timeout value, default: 20ms */
660-
#define DEFAULT_SCHEDULE_TIMEOUT (msecs_to_jiffies(20))
661+
/* IO/non-IO congestion wait timeout value, default: 1ms */
662+
#define DEFAULT_SCHEDULE_TIMEOUT (msecs_to_jiffies(1))
661663

662664
/* timeout value injected, default: 1000ms */
663665
#define DEFAULT_FAULT_TIMEOUT (msecs_to_jiffies(1000))

fs/f2fs/segment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3471,7 +3471,7 @@ static unsigned int __issue_discard_cmd_range(struct f2fs_sb_info *sbi,
34713471
blk_finish_plug(&plug);
34723472
mutex_unlock(&dcc->cmd_lock);
34733473
trimmed += __wait_all_discard_cmd(sbi, NULL);
3474-
f2fs_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT);
3474+
f2fs_schedule_timeout(DEFAULT_DISCARD_INTERVAL);
34753475
goto next;
34763476
}
34773477
skip:

0 commit comments

Comments
 (0)