diff options
| author | Chao Yu <yuchao0@huawei.com> | 2017-04-25 00:21:35 +0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-05-21 18:42:54 +0200 |
| commit | f48ebd6859d0d016ca13d0d5fcb0d575395ac41a (patch) | |
| tree | 584ea1d59f1f8d42e2a15025a87e38ac69cce387 | |
| parent | 83c5babdfc10b32044f7100c15a0a2a5eef2ad0b (diff) | |
f2fs: enable small discard by default
This patch start to enable 4K granularity small discard by default
when realtime discard is on, so, in seriously fragmented space,
small size discard can be issued in time to avoid useless storage
space occupying of invalid filesystem's data, then performance of
flash storage can be recovered.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/f2fs.h | 4 | ||||
| -rw-r--r-- | fs/f2fs/segment.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 3a6c3fb96..b306d333a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -329,8 +329,8 @@ struct discard_cmd_control { struct list_head wait_list; /* store on-flushing entries */ wait_queue_head_t discard_wait_queue; /* waiting queue for wake-up */ struct mutex cmd_lock; - int nr_discards; /* # of discards in the list */ - int max_discards; /* max. discards to be issued */ + unsigned int nr_discards; /* # of discards in the list */ + unsigned int max_discards; /* max. discards to be issued */ unsigned int undiscard_blks; /* # of undiscard blocks */ atomic_t issued_discard; /* # of issued discard */ atomic_t issing_discard; /* # of issing discard */ diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e68c3965d..08dba7ebe 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1500,7 +1500,7 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi) atomic_set(&dcc->issing_discard, 0); atomic_set(&dcc->discard_cmd_cnt, 0); dcc->nr_discards = 0; - dcc->max_discards = 0; + dcc->max_discards = MAIN_SEGS(sbi) << sbi->log_blocks_per_seg; dcc->undiscard_blks = 0; dcc->root = RB_ROOT; |
