lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YcEAnX2+ARaGXrtx@google.com>
Date:   Mon, 20 Dec 2021 14:15:57 -0800
From:   Jaegeuk Kim <jaegeuk@...nel.org>
To:     Chao Yu <chao@...nel.org>
Cc:     linux-kernel@...r.kernel.org,
        linux-f2fs-devel@...ts.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: avoid down_write on nat_tree_lock
 during checkpoint

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@...nel.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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ