Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1186660 > unrolled thread

[PATCH 1/3] f2fs: skip writing in ->writepages when no dirty pages exist

Started byChao Yu <chao2.yu@samsung.com>
First post2015-07-17 12:10 +0200
Last post2015-07-17 12:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] f2fs: skip writing in ->writepages when no dirty pages  exist Chao Yu <chao2.yu@samsung.com> - 2015-07-17 12:10 +0200

#1186660 — [PATCH 1/3] f2fs: skip writing in ->writepages when no dirty pages exist

FromChao Yu <chao2.yu@samsung.com>
Date2015-07-17 12:10 +0200
Subject[PATCH 1/3] f2fs: skip writing in ->writepages when no dirty pages exist
Message-ID<pNaKB-2i1-3@gated-at.bofh.it>
When flushing comes from background, if there is no dirty page in the
mapping of inode, we'd better to skip seeking dirty page from mapping
for writebacking.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 fs/f2fs/data.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index b621c08..5370a74 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1284,6 +1284,10 @@ static int f2fs_write_data_pages(struct address_space *mapping,
 	if (!mapping->a_ops->writepage)
 		return 0;
 
+	/* skip writing if there is no dirty page in this inode */
+	if (!get_dirty_pages(inode) && wbc->sync_mode == WB_SYNC_NONE)
+		return 0;
+
 	if (S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_NONE &&
 			get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) &&
 			available_free_memory(sbi, DIRTY_DENTS))
-- 
2.4.2


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web