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

Commit 38d74d51 authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Revert "f2fs: let discard thread wait a little longer if dev is busy"



This reverts commit 161d1c91.

This is a preparation change for merging android-4.14 commit
73421a43 into msm-4.14 branch.
The reverted change is committed already as:

39fe1cda f2fs: let discard thread wait a little longer if dev is busy

Change-Id: Id68c93b211c9c5a1de850e40591a82f4cc1c74ef
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parent 20b4ec1c
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -181,7 +181,6 @@ enum {
#define DEF_MAX_DISCARD_REQUEST		8	/* issue 8 discards per round */
#define DEF_MAX_DISCARD_LEN		512	/* Max. 2MB per discard */
#define DEF_MIN_DISCARD_ISSUE_TIME	50	/* 50 ms, if exists */
#define DEF_MID_DISCARD_ISSUE_TIME	500	/* 500 ms, if device busy */
#define DEF_MAX_DISCARD_ISSUE_TIME	60000	/* 60 s, if no candidates */
#define DEF_DISCARD_URGENT_UTIL		80	/* do more discard over 80% */
#define DEF_CP_INTERVAL			60	/* 60 secs */
@@ -284,7 +283,6 @@ enum {
struct discard_policy {
	int type;			/* type of discard */
	unsigned int min_interval;	/* used for candidates exist */
	unsigned int mid_interval;	/* used for device busy */
	unsigned int max_interval;	/* used for candidates not exist */
	unsigned int max_requests;	/* # of discards issued per round */
	unsigned int io_aware_gran;	/* minimum granularity discard not be aware of I/O */
+1 −5
Original line number Diff line number Diff line
@@ -941,7 +941,6 @@ static void __init_discard_policy(struct f2fs_sb_info *sbi,

	if (discard_type == DPOLICY_BG) {
		dpolicy->min_interval = DEF_MIN_DISCARD_ISSUE_TIME;
		dpolicy->mid_interval = DEF_MID_DISCARD_ISSUE_TIME;
		dpolicy->max_interval = DEF_MAX_DISCARD_ISSUE_TIME;
		dpolicy->io_aware = true;
		dpolicy->sync = false;
@@ -951,7 +950,6 @@ static void __init_discard_policy(struct f2fs_sb_info *sbi,
		}
	} else if (discard_type == DPOLICY_FORCE) {
		dpolicy->min_interval = DEF_MIN_DISCARD_ISSUE_TIME;
		dpolicy->mid_interval = DEF_MID_DISCARD_ISSUE_TIME;
		dpolicy->max_interval = DEF_MAX_DISCARD_ISSUE_TIME;
		dpolicy->io_aware = false;
	} else if (discard_type == DPOLICY_FSTRIM) {
@@ -1429,11 +1427,9 @@ static int issue_discard_thread(void *data)
		sb_start_intwrite(sbi->sb);

		issued = __issue_discard_cmd(sbi, &dpolicy);
		if (issued > 0) {
		if (issued) {
			__wait_all_discard_cmd(sbi, &dpolicy);
			wait_ms = dpolicy.min_interval;
		} else if (issued == -1){
			wait_ms = dpolicy.mid_interval;
		} else {
			wait_ms = dpolicy.max_interval;
		}