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:   Mon, 12 Nov 2018 16:15:17 -0800
From:   Jaegeuk Kim <jaegeuk@...nel.org>
To:     Yunlong Song <yunlong.song@...wei.com>
Cc:     chao@...nel.org, yuchao0@...wei.com, yunlong.song@...oud.com,
        miaoxie@...wei.com, bintian.wang@...wei.com, shengyong1@...wei.com,
        heyunlei@...wei.com, linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] f2fs: only flush the single temp bio cache which owns
 the target page

On 10/24, Yunlong Song wrote:
> Previously, when f2fs finds which temp bio cache owns the target page,
> it will flush all the three temp bio caches, but we only need to flush
> one single bio cache indeed, which can help to keep bio merged.
> 
> Signed-off-by: Yunlong Song <yunlong.song@...wei.com>
> ---
>  fs/f2fs/data.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 106f116..882e217 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -396,13 +396,17 @@ static bool has_merged_page(struct f2fs_sb_info *sbi, struct inode *inode,
>  }
>  
>  static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
> -				enum page_type type, enum temp_type temp)
> +				struct inode *inode, struct page *page, nid_t ino,
> +				enum page_type type, enum temp_type temp, bool force)
>  {
>  	enum page_type btype = PAGE_TYPE_OF_BIO(type);
>  	struct f2fs_bio_info *io = sbi->write_io[btype] + temp;
>  
>  	down_write(&io->io_rwsem);
>  
> +	if (!force && !__has_merged_page(io, inode, page, ino))
> +		goto out;

Could you clean up this to call once in __submit_merged_write_cond() only?

> +
>  	/* change META to META_FLUSH in the checkpoint procedure */
>  	if (type >= META_FLUSH) {
>  		io->fio.type = META_FLUSH;
> @@ -412,6 +416,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
>  			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
>  	}
>  	__submit_merged_bio(io);
> +out:
>  	up_write(&io->io_rwsem);
>  }
>  
> @@ -426,7 +431,7 @@ static void __submit_merged_write_cond(struct f2fs_sb_info *sbi,
>  
>  	for (temp = HOT; temp < NR_TEMP_TYPE; temp++) {
>  
> -		__f2fs_submit_merged_write(sbi, type, temp);
> +		__f2fs_submit_merged_write(sbi, inode, page, ino, type, temp, force);
>  
>  		/* TODO: use HOT temp only for meta pages now. */
>  		if (type >= META)
> -- 
> 1.8.5.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ