From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: 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: Mon, 20 Dec 2021 14:15:57 -0800 [thread overview]
Message-ID: <YcEAnX2+ARaGXrtx@google.com> (raw)
In-Reply-To: <443927c3-8eaf-8f00-0e41-2173143fe166@kernel.org>
On 12/19, Chao Yu wrote:
> 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().
I'm focusing on faster checkpoint by minimizing the nat_tree_lock holding time.
>
> Thanks,
>
> > + return;
> > +
> > new = __alloc_nat_entry(sbi, nid, false);
> > if (!new)
> > return;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: 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: Mon, 20 Dec 2021 14:15:57 -0800 [thread overview]
Message-ID: <YcEAnX2+ARaGXrtx@google.com> (raw)
In-Reply-To: <443927c3-8eaf-8f00-0e41-2173143fe166@kernel.org>
On 12/19, Chao Yu wrote:
> 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().
I'm focusing on faster checkpoint by minimizing the nat_tree_lock holding time.
>
> Thanks,
>
> > + return;
> > +
> > new = __alloc_nat_entry(sbi, nid, false);
> > if (!new)
> > return;
next prev parent reply other threads:[~2021-12-20 22:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 18:24 [f2fs-dev] [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock during checkpoint Jaegeuk Kim
2021-12-14 18:24 ` Jaegeuk Kim
2021-12-14 18:24 ` [f2fs-dev] [PATCH 2/2] f2fs: do not bother checkpoint by f2fs_get_node_info Jaegeuk Kim
2021-12-14 18:24 ` Jaegeuk Kim
2021-12-30 6:37 ` [f2fs-dev] " Chao Yu
2021-12-30 6:37 ` 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-19 8:53 ` Chao Yu
2021-12-20 22:15 ` Jaegeuk Kim [this message]
2021-12-20 22:15 ` Jaegeuk Kim
2021-12-30 6:36 ` Chao Yu
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=YcEAnX2+ARaGXrtx@google.com \
--to=jaegeuk@kernel.org \
--cc=chao@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 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.