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]
Date:   Fri, 10 Aug 2018 09:36:29 +0800
From:   Chao Yu <yuchao0@...wei.com>
To:     Jaegeuk Kim <jaegeuk@...nel.org>
CC:     <linux-kernel@...r.kernel.org>,
        <linux-f2fs-devel@...ts.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH v3] f2fs: avoid fi->i_gc_rwsem[WRITE] lock in
 f2fs_gc

On 2018/8/10 3:59, Jaegeuk Kim wrote:
> Yup, how about this?
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index d816c328f02b..cb510fb36523 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1052,6 +1052,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
>  		.iroot = RADIX_TREE_INIT(gc_list.iroot, GFP_NOFS),
>  	};
>  	unsigned long long last_skipped = sbi->skipped_atomic_files[FG_GC];
> +	unsigned long long first_skipped;
>  	unsigned int skipped_round = 0, round = 0;
>  
>  	trace_f2fs_gc_begin(sbi->sb, sync, background,
> @@ -1064,8 +1065,10 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
>  				prefree_segments(sbi));
>  
>  	cpc.reason = __get_cp_reason(sbi);
> -	sbi->skipped_gc_rwsem = 0;
>  gc_more:
> +	sbi->skipped_gc_rwsem = 0;
> +	first_skipped = last_skipped;
> +
>  	if (unlikely(!(sbi->sb->s_flags & SB_ACTIVE))) {
>  		ret = -EINVAL;
>  		goto stop;
> @@ -1126,8 +1129,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
>  			goto gc_more;
>  		}
>  
> -		if (sbi->skipped_atomic_files[FG_GC] == last_skipped &&
> -				sbi->skipped_atomic_files[FG_GC] >
> +		if (first_skipped < last_skipped &&
> +				(last_skipped - first_skipped) >

IMO, it would be better to judge the condition with skipped number in all round
of FGGC instead of last round, since number in last round may not very accurate.

Thoughts?

Thanks,

>  						sbi->skipped_gc_rwsem) {
>  			f2fs_drop_inmem_pages_all(sbi, true);
>  			segno = NULL_SEGNO;
> 
> .
> 

Powered by blists - more mailing lists