From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint
Date: Sun, 19 Dec 2021 16:53:57 +0800 [thread overview]
Message-ID: <443927c3-8eaf-8f00-0e41-2173143fe166@kernel.org> (raw)
In-Reply-To: <20211214182435.2595176-1-jaegeuk@kernel.org>
On 2021/12/15 2:24, Jaegeuk Kim wrote:
> 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))
Why not down_write_trylock(nat_tree_lock)? cp_global_sem lock coverage is larger than
nat_tree_lock's in f2fs_write_checkpoint().
Thanks,
> + return;
> +
> new = __alloc_nat_entry(sbi, nid, false);
> if (!new)
> return;
next prev parent reply other threads:[~2021-12-19 8:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2021-12-30 6:37 ` [f2fs-dev] " Chao Yu
2021-12-19 8:53 ` Chao Yu [this message]
2021-12-20 22:15 ` [f2fs-dev] [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint Jaegeuk Kim
2021-12-30 6:36 ` Chao Yu
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=443927c3-8eaf-8f00-0e41-2173143fe166@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®