linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: use IPU for cold files
@ 2017-08-08  1:42 Jaegeuk Kim
  2017-08-08  1:42 ` [PATCH 2/2] f2fs: introduce gc_urgent mode for background GC Jaegeuk Kim
  2017-08-08  2:57 ` [PATCH 1/2] f2fs: use IPU for cold files Chao Yu
  0 siblings, 2 replies; 7+ messages in thread
From: Jaegeuk Kim @ 2017-08-08  1:42 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

We expect cold files write data sequentially, but sometimes some of small data
can be updated, which incurs fragmentation.
Let's avoid that.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/segment.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 6b871b492fd5..7f700e54b77d 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -577,6 +577,10 @@ static inline bool need_inplace_update_policy(struct inode *inode,
 	if (test_opt(sbi, LFS))
 		return false;
 
+	/* if this is cold file, we should overwrite to avoid fragmentation */
+	if (file_is_cold(inode))
+		return true;
+
 	if (policy & (0x1 << F2FS_IPU_FORCE))
 		return true;
 	if (policy & (0x1 << F2FS_IPU_SSR) && need_SSR(sbi))
-- 
2.13.0.rc1.294.g07d810a77f-goog

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-10 10:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08  1:42 [PATCH 1/2] f2fs: use IPU for cold files Jaegeuk Kim
2017-08-08  1:42 ` [PATCH 2/2] f2fs: introduce gc_urgent mode for background GC Jaegeuk Kim
2017-08-08  3:09   ` [PATCH 2/2 v2] " Jaegeuk Kim
2017-08-08  3:15   ` [PATCH 2/2] " Chao Yu
2017-08-08  3:40     ` Jaegeuk Kim
2017-08-10 10:44   ` Chao Yu
2017-08-08  2:57 ` [PATCH 1/2] f2fs: use IPU for cold files 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).