Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dee02f0d authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: issue discard aggressively in the gc_urgent mode



This patch avoids to skip discard commands when user sets gc_urgent mode.

Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 782911f4
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1411,12 +1411,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);
		}
			init_discard_policy(&dpolicy, DPOLICY_FORCE, 1);

		sb_start_intwrite(sbi->sb);

@@ -1727,7 +1726,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) {