public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao2.yu@samsung.com>
To: "'Jaegeuk Kim'" <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: RE: [f2fs-dev] [PATCH 01/11] f2fs: add nobarrier mount option
Date: Tue, 29 Jul 2014 19:28:16 +0800	[thread overview]
Message-ID: <007d01cfab20$4d5cbc20$e8163460$@samsung.com> (raw)
In-Reply-To: <1406328445-63707-1-git-send-email-jaegeuk@kernel.org>

Hi Jaegeuk,

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Saturday, July 26, 2014 6:47 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 01/11] f2fs: add nobarrier mount option
> 
> This patch adds a mount option, nobarrier, in f2fs.
> The assumption in here is that file system keeps the IO ordering, but
> doesn't care about cache flushes inside the storages.

Looks good to me.
But it's better to add some description in f2fs document.

> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>

> ---
>  fs/f2fs/data.c    | 5 ++++-
>  fs/f2fs/f2fs.h    | 1 +
>  fs/f2fs/segment.c | 3 +++
>  fs/f2fs/super.c   | 7 +++++++
>  4 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index c77c667..482313d 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -139,7 +139,10 @@ void f2fs_submit_merged_bio(struct f2fs_sb_info *sbi,
>  	/* change META to META_FLUSH in the checkpoint procedure */
>  	if (type >= META_FLUSH) {
>  		io->fio.type = META_FLUSH;
> -		io->fio.rw = WRITE_FLUSH_FUA | REQ_META | REQ_PRIO;
> +		if (test_opt(sbi, NOBARRIER))
> +			io->fio.rw = WRITE_FLUSH | REQ_META | REQ_PRIO;
> +		else
> +			io->fio.rw = WRITE_FLUSH_FUA | REQ_META | REQ_PRIO;
>  	}
>  	__submit_merged_bio(io);
>  	up_write(&io->io_rwsem);
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 8f507d4..e999eec 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -41,6 +41,7 @@
>  #define F2FS_MOUNT_INLINE_XATTR		0x00000080
>  #define F2FS_MOUNT_INLINE_DATA		0x00000100
>  #define F2FS_MOUNT_FLUSH_MERGE		0x00000200
> +#define F2FS_MOUNT_NOBARRIER		0x00000400
> 
>  #define clear_opt(sbi, option)	(sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)
>  #define set_opt(sbi, option)	(sbi->mount_opt.opt |= F2FS_MOUNT_##option)
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 8a6e57d..9fce0f47 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -239,6 +239,9 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi)
>  	struct flush_cmd_control *fcc = SM_I(sbi)->cmd_control_info;
>  	struct flush_cmd cmd;
> 
> +	if (test_opt(sbi, NOBARRIER))
> +		return 0;
> +
>  	if (!test_opt(sbi, FLUSH_MERGE))
>  		return blkdev_issue_flush(sbi->sb->s_bdev, GFP_KERNEL, NULL);
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 34649aa..eec89a2 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -52,6 +52,7 @@ enum {
>  	Opt_inline_xattr,
>  	Opt_inline_data,
>  	Opt_flush_merge,
> +	Opt_nobarrier,
>  	Opt_err,
>  };
> 
> @@ -69,6 +70,7 @@ static match_table_t f2fs_tokens = {
>  	{Opt_inline_xattr, "inline_xattr"},
>  	{Opt_inline_data, "inline_data"},
>  	{Opt_flush_merge, "flush_merge"},
> +	{Opt_nobarrier, "nobarrier"},
>  	{Opt_err, NULL},
>  };
> 
> @@ -339,6 +341,9 @@ static int parse_options(struct super_block *sb, char *options)
>  		case Opt_flush_merge:
>  			set_opt(sbi, FLUSH_MERGE);
>  			break;
> +		case Opt_nobarrier:
> +			set_opt(sbi, NOBARRIER);
> +			break;
>  		default:
>  			f2fs_msg(sb, KERN_ERR,
>  				"Unrecognized mount option \"%s\" or missing value",
> @@ -544,6 +549,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
>  		seq_puts(seq, ",inline_data");
>  	if (!f2fs_readonly(sbi->sb) && test_opt(sbi, FLUSH_MERGE))
>  		seq_puts(seq, ",flush_merge");
> +	if (!f2fs_readonly(sbi->sb) && test_opt(sbi, NOBARRIER))
> +		seq_puts(seq, ",nobarrier");
>  	seq_printf(seq, ",active_logs=%u", sbi->active_logs);
> 
>  	return 0;
> --
> 1.8.5.2 (Apple Git-48)
> 
> 
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


  parent reply	other threads:[~2014-07-29 11:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 22:47 [PATCH 01/11] f2fs: add nobarrier mount option Jaegeuk Kim
2014-07-25 22:47 ` [PATCH 02/11] f2fs: punch the core function for inode management Jaegeuk Kim
2014-07-29 11:29   ` [f2fs-dev] " Chao Yu
2014-07-25 22:47 ` [PATCH 03/11] f2fs: add infra for ino management Jaegeuk Kim
2014-07-29 11:30   ` [f2fs-dev] " Chao Yu
2014-07-25 22:47 ` [PATCH 04/11] f2fs: use radix_tree " Jaegeuk Kim
2014-07-29 11:32   ` [f2fs-dev] " Chao Yu
2014-07-29 12:34     ` Jaegeuk Kim
2014-07-25 22:47 ` [PATCH 05/11] f2fs: add info of appended or updated data writes Jaegeuk Kim
2014-07-29 11:38   ` [f2fs-dev] " Chao Yu
2014-07-25 22:47 ` [PATCH 06/11] f2fs: skip unnecessary data writes during fsync Jaegeuk Kim
2014-07-29 11:39   ` [f2fs-dev] " Chao Yu
2014-07-29 12:43     ` Jaegeuk Kim
2014-07-30 11:58       ` Chao Yu
2014-07-25 22:47 ` [PATCH 07/11] f2fs: enable in-place-update for fdatasync Jaegeuk Kim
2014-07-29  0:41   ` [f2fs-dev] " Changman Lee
2014-07-29 12:22     ` Jaegeuk Kim
2014-07-29 23:54       ` Changman Lee
2014-07-30  1:08         ` Jaegeuk Kim
2014-07-30  1:56           ` Changman Lee
2014-07-30  3:11             ` Jaegeuk Kim
2014-07-30  2:45           ` Chao Yu
2014-07-30  3:13             ` Jaegeuk Kim
2014-07-30 12:48               ` Chao Yu
2014-07-25 22:47 ` [PATCH 08/11] f2fs: fix wrong condition for unlikely Jaegeuk Kim
2014-07-30  1:44   ` [f2fs-dev] " Chao Yu
2014-07-30  3:18     ` Jaegeuk Kim
2014-07-30 12:58       ` Chao Yu
2014-07-25 22:47 ` [PATCH 09/11] f2fs: test before set/clear bits Jaegeuk Kim
2014-07-25 22:47 ` [PATCH 10/11] f2fs: avoid checkpoint when error was occurred Jaegeuk Kim
2014-07-29 11:41   ` [f2fs-dev] " Chao Yu
2014-07-29 13:00     ` Jaegeuk Kim
2014-07-25 22:47 ` [PATCH 11/11] f2fs: avoid retrying wrong recovery routine " Jaegeuk Kim
2014-07-29 13:01   ` [PATCH v2 " Jaegeuk Kim
2014-07-29 11:28 ` Chao Yu [this message]
2014-07-29 12:22   ` [f2fs-dev] [PATCH 01/11] f2fs: add nobarrier mount option Jaegeuk Kim

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='007d01cfab20$4d5cbc20$e8163460$@samsung.com' \
    --to=chao2.yu@samsung.com \
    --cc=jaegeuk@kernel.org \
    --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