All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] f2fs: avoid needless lock for node pages when fsyncing a file
@ 2016-04-26  0:06 ` Jaegeuk Kim
  0 siblings, 0 replies; 19+ messages in thread
From: Jaegeuk Kim @ 2016-04-26  0:06 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

When fsync is called, sync_node_pages finds a proper direct node pages to flush.
But, it locks unrelated direct node pages together unnecessarily.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/node.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 095fc2c..cccee50 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1272,10 +1272,14 @@ next_step:
 			 * we should not skip writing node pages.
 			 */
 lock_node:
-			if (ino && ino_of_node(page) == ino)
-				lock_page(page);
-			else if (!trylock_page(page))
+			if (ino) {
+				if (ino_of_node(page) == ino)
+					lock_page(page);
+				else
+					continue;
+			} else if (!trylock_page(page)) {
 				continue;
+			}
 
 			if (unlikely(page->mapping != NODE_MAPPING(sbi))) {
 continue_unlock:
-- 
2.6.3

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

end of thread, other threads:[~2016-04-27 17:40 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26  0:06 [PATCH 1/7] f2fs: avoid needless lock for node pages when fsyncing a file Jaegeuk Kim
2016-04-26  0:06 ` Jaegeuk Kim
2016-04-26  0:06 ` [PATCH 2/7] f2fs: avoid writing 0'th page in volatile writes Jaegeuk Kim
2016-04-26  0:06   ` Jaegeuk Kim
2016-04-26  0:06 ` [PATCH 3/7] f2fs: split sync_node_pages with fsync_node_pages Jaegeuk Kim
2016-04-26  0:06   ` Jaegeuk Kim
2016-04-26  0:06 ` [PATCH 4/7] f2fs: report unwritten status in fsync_node_pages Jaegeuk Kim
2016-04-26  0:06   ` Jaegeuk Kim
2016-04-26  0:06 ` [PATCH 5/7] f2fs: set fsync mark only for the last dnode Jaegeuk Kim
2016-04-26  0:06   ` Jaegeuk Kim
2016-04-26  0:06 ` [PATCH 6/7] f2fs: issue cache flush on direct IO Jaegeuk Kim
2016-04-26  0:06   ` Jaegeuk Kim
2016-04-26  0:07 ` [PATCH 7/7] f2fs: should check the remaining dentry bits Jaegeuk Kim
2016-04-26  0:07   ` Jaegeuk Kim
2016-04-26  2:53   ` [PATCH v2 " Jaegeuk Kim
2016-04-27 14:22   ` [f2fs-dev] [PATCH " Chao Yu
2016-04-27 17:40     ` Jaegeuk Kim
2016-04-26 12:51 ` [f2fs-dev] [PATCH 1/7] f2fs: avoid needless lock for node pages when fsyncing a file Chao Yu
2016-04-26 12:51   ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.