* [PATCH v3] f2fs: fix to be aware discard/preflush/dio command in is_idle()
@ 2018-11-11 16:55 Chao Yu
0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2018-11-11 16:55 UTC (permalink / raw)
To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, Chao Yu
From: Chao Yu <yuchao0@huawei.com>
This patch adds missing in-flight discard/preflush/dio command count
check in is_idle().
Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
v3:
- add in-flight r/w dio count check as well.
fs/f2fs/f2fs.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 97c35036bf49..b1d5031be2d5 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -2157,7 +2157,11 @@ static inline bool is_idle(struct f2fs_sb_info *sbi, int type)
{
if (get_pages(sbi, F2FS_RD_DATA) || get_pages(sbi, F2FS_RD_NODE) ||
get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) ||
- get_pages(sbi, F2FS_WB_CP_DATA))
+ get_pages(sbi, F2FS_WB_CP_DATA) ||
+ get_pages(sbi, F2FS_DIO_READ) ||
+ get_pages(sbi, F2FS_DIO_WRITE) ||
+ atomic_read(&SM_I(sbi)->dcc_info->issing_discard) ||
+ atomic_read(&SM_I(sbi)->fcc_info->issing_flush))
return false;
return f2fs_time_over(sbi, type);
}
--
2.18.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-11 16:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-11 16:55 [PATCH v3] f2fs: fix to be aware discard/preflush/dio command in is_idle() Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).