public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao2.yu@samsung.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 4/4] f2fs: call f2fs_balance_fs only when node was changed
Date: Wed, 23 Dec 2015 11:13:38 -0800	[thread overview]
Message-ID: <20151223191338.GD30505@jaegeuk.local> (raw)
In-Reply-To: <010b01d13d66$f85f2ac0$e91d8040$@samsung.com>

Hi Chao,

On Wed, Dec 23, 2015 at 05:46:59PM +0800, Chao Yu wrote:
> Hi Jaegeuk,
> 
> > -----Original Message-----
> > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> > Sent: Wednesday, December 23, 2015 9:00 AM
> > To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> > linux-f2fs-devel@lists.sourceforge.net
> > Cc: Jaegeuk Kim
> > Subject: [f2fs-dev] [PATCH 4/4] f2fs: call f2fs_balance_fs only when node was changed
> > 
> > If user tries to update or read data, we don't need to call f2fs_balance_fs
> > which triggers f2fs_gc, which increases unnecessary long latency.
> 
> One missing case is get_data_block_dio, how about also covering it based on
> following patch?

It makes sense.
I'll submit v2.

Thanks,

> 
> 
> >From 7175efac7473e7a04285055c69edfb7432f8ca4e Mon Sep 17 00:00:00 2001
> From: Chao Yu <chao2.yu@samsung.com>
> Date: Wed, 23 Dec 2015 17:11:43 +0800
> Subject: [PATCH] f2fs: reduce covered region of sbi->cp_rwsem in
>  f2fs_map_blocks
> 
> Only cover sbi->cp_rwsem on one dnode page's allocation and modification
> instead of multiple's in f2fs_map_blocks, it can reduce the covered region
> of cp_rwsem, then we can avoid potential long time delay for concurrent
> checkpointer.
> 
> Signed-off-by: Chao Yu <chao2.yu@samsung.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 8f8f8b0..3c83b16 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -594,7 +594,7 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
>  	}
>  
>  	if (create)
> -		f2fs_lock_op(F2FS_I_SB(inode));
> +		f2fs_lock_op(sbi);
>  
>  	/* When reading holes, we need its node page */
>  	set_new_dnode(&dn, inode, NULL, NULL, 0);
> @@ -651,6 +651,11 @@ get_next:
>  		allocated = false;
>  		f2fs_put_dnode(&dn);
>  
> +		if (create) {
> +			f2fs_unlock_op(sbi);
> +			f2fs_lock_op(sbi);
> +		}
> +
>  		set_new_dnode(&dn, inode, NULL, NULL, 0);
>  		err = get_dnode_of_data(&dn, pgofs, mode);
>  		if (err) {
> @@ -706,7 +711,7 @@ put_out:
>  	f2fs_put_dnode(&dn);
>  unlock_out:
>  	if (create)
> -		f2fs_unlock_op(F2FS_I_SB(inode));
> +		f2fs_unlock_op(sbi);
>  out:
>  	trace_f2fs_map_blocks(inode, map, err);
>  	return err;
> -- 
> 2.6.3
> 

  reply	other threads:[~2015-12-23 19:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23  0:59 [PATCH 1/4] f2fs: check inline_data flag at converting time Jaegeuk Kim
2015-12-23  0:59 ` [PATCH 2/4] f2fs: avoid unnecessary f2fs_gc for dir operations Jaegeuk Kim
2015-12-23  3:26   ` [f2fs-dev] " Chao Yu
2015-12-23 18:54     ` [f2fs-dev] [PATCH 2/4 v2] " Jaegeuk Kim
2015-12-24  1:32       ` Chao Yu
2015-12-24  2:13         ` Jaegeuk Kim
2015-12-24  3:30           ` Chao Yu
2015-12-23  0:59 ` [PATCH 3/4] f2fs: record node block allocation in dnode_of_data Jaegeuk Kim
2015-12-23  8:00   ` [f2fs-dev] " Chao Yu
2015-12-23 18:57     ` Jaegeuk Kim
2015-12-23 19:00   ` [PATCH 3/4 v2] " Jaegeuk Kim
2015-12-24  1:35     ` [f2fs-dev] " Chao Yu
2015-12-23  0:59 ` [PATCH 4/4] f2fs: call f2fs_balance_fs only when node was changed Jaegeuk Kim
2015-12-23  9:46   ` [f2fs-dev] " Chao Yu
2015-12-23 19:13     ` Jaegeuk Kim [this message]
2015-12-25  1:38     ` Chao Yu
2015-12-23 19:14   ` Jaegeuk Kim
2015-12-24  5:48     ` [f2fs-dev] " Chao Yu
2015-12-23  3:19 ` [f2fs-dev] [PATCH 1/4] f2fs: check inline_data flag at converting time 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=20151223191338.GD30505@jaegeuk.local \
    --to=jaegeuk@kernel.org \
    --cc=chao2.yu@samsung.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --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