linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Zhang Qilong via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: <jaegeuk@kernel.org>, <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH -next] f2fs: total hit count should only be increased when entry found
Date: Mon, 5 Sep 2022 22:12:25 +0800	[thread overview]
Message-ID: <20220905141225.26456-1-zhangqilong3@huawei.com> (raw)

We should not increase total hit count when not
found the entry in cache extent tree. Remove the
stat_inc_total_hit when f2fs_lookup_rb_tree returns
nullptr.

Fixes:54c2258cd63a8 ("f2fs: extract rb-tree operation infrastructure")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 fs/f2fs/extent_cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c
index 866e72b29bd5..264682eebcd1 100644
--- a/fs/f2fs/extent_cache.c
+++ b/fs/f2fs/extent_cache.c
@@ -426,6 +426,7 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
 		*ei = et->largest;
 		ret = true;
 		stat_inc_largest_node_hit(sbi);
+		stat_inc_total_hit(sbi);
 		goto out;
 	}
 
@@ -447,8 +448,8 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
 	}
 	spin_unlock(&sbi->extent_lock);
 	ret = true;
-out:
 	stat_inc_total_hit(sbi);
+out:
 	read_unlock(&et->lock);
 
 	trace_f2fs_lookup_extent_tree_end(inode, pgofs, ei);
-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply	other threads:[~2022-09-05 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 14:12 Zhang Qilong via Linux-f2fs-devel [this message]
2022-09-06  3:10 ` [f2fs-dev] [PATCH -next] f2fs: total hit count should only be increased when entry found Chao Yu
2022-09-06  7:14   ` [f2fs-dev] 答复: " zhangqilong via Linux-f2fs-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220905141225.26456-1-zhangqilong3@huawei.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=zhangqilong3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).