lkml.org 
[lkml]   [2018]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] f2fs: give another chance to issue discard with current granularity
Date
If discard IOs are blocked by user IO, do not skip to select and issue
discard with lower granularity, retry with current granularity.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
fs/f2fs/segment.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 60f54ed1413a..13f5e3665bf0 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1199,6 +1199,7 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
pend_list = &dcc->pend_list[i];

mutex_lock(&dcc->cmd_lock);
+retry:
if (list_empty(pend_list))
goto next;
if (unlikely(dcc->rbtree_check))
@@ -1221,6 +1222,13 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
break;
}
blk_finish_plug(&plug);
+
+ /*
+ * if discard IO was interrupted by user IOs, give another
+ * chance to issue discard with current granularity.
+ */
+ if (io_interrupted)
+ goto retry;
next:
mutex_unlock(&dcc->cmd_lock);

--
2.18.0.rc1
\
 
 \ /
  Last update: 2018-07-03 14:19    [W:0.047 / U:3.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site