linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint
@ 2021-12-14 18:24 Jaegeuk Kim
  2021-12-14 18:24 ` [PATCH 2/2] f2fs: do not bother checkpoint by f2fs_get_node_info Jaegeuk Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jaegeuk Kim @ 2021-12-14 18:24 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim

Let's cache nat entry if there's no lock contention only.

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

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 556fcd8457f3..b1bc7d76da3b 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -430,6 +430,10 @@ static void cache_nat_entry(struct f2fs_sb_info *sbi, nid_t nid,
 	struct f2fs_nm_info *nm_i = NM_I(sbi);
 	struct nat_entry *new, *e;
 
+	/* Let's mitigate lock contention of nat_tree_lock during checkpoint */
+	if (rwsem_is_locked(&sbi->cp_global_sem))
+		return;
+
 	new = __alloc_nat_entry(sbi, nid, false);
 	if (!new)
 		return;
-- 
2.34.1.173.g76aa8bc2d0-goog


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

end of thread, other threads:[~2021-12-30  6:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 18:24 [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint Jaegeuk Kim
2021-12-14 18:24 ` [PATCH 2/2] f2fs: do not bother checkpoint by f2fs_get_node_info Jaegeuk Kim
2021-12-30  6:37   ` [f2fs-dev] " Chao Yu
2021-12-19  8:53 ` [f2fs-dev] [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint Chao Yu
2021-12-20 22:15   ` Jaegeuk Kim
2021-12-30  6:36 ` 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).