Skip to content

Commit

Permalink
f2fs: issue discard aggressively in the gc_urgent mode
Browse files Browse the repository at this point in the history
This patch avoids to skip discard commands when user sets gc_urgent mode.

Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
Jaegeuk Kim committed Apr 12, 2018
1 parent 820bafa commit 43df79e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -1492,12 +1492,11 @@ static int issue_discard_thread(void *data)
if (kthread_should_stop())
return 0;

if (dcc->discard_wake) {
if (dcc->discard_wake)
dcc->discard_wake = 0;
if (sbi->gc_thread && sbi->gc_thread->gc_urgent)
init_discard_policy(&dpolicy,
DPOLICY_FORCE, 1);
}

if (sbi->gc_thread && sbi->gc_thread->gc_urgent)
init_discard_policy(&dpolicy, DPOLICY_FORCE, 1);

sb_start_intwrite(sbi->sb);

Expand Down Expand Up @@ -1808,7 +1807,7 @@ void init_discard_policy(struct discard_policy *dpolicy,
} else if (discard_type == DPOLICY_FORCE) {
dpolicy->min_interval = DEF_MIN_DISCARD_ISSUE_TIME;
dpolicy->max_interval = DEF_MAX_DISCARD_ISSUE_TIME;
dpolicy->io_aware = true;
dpolicy->io_aware = false;
} else if (discard_type == DPOLICY_FSTRIM) {
dpolicy->io_aware = false;
} else if (discard_type == DPOLICY_UMOUNT) {
Expand Down

0 comments on commit 43df79e

Please sign in to comment.