All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 05/10] f2fs: get io size bit from mount option
Date: Fri, 30 Dec 2016 10:51:12 -0800	[thread overview]
Message-ID: <20161230185117.3832-5-jaegeuk@kernel.org> (raw)
In-Reply-To: <20161230185117.3832-1-jaegeuk@kernel.org>

This patch adds to set io_size_bits from mount option.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 Documentation/filesystems/f2fs.txt |  2 ++
 fs/f2fs/super.c                    | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt
index 753dd4f96afe..d99faced79cb 100644
--- a/Documentation/filesystems/f2fs.txt
+++ b/Documentation/filesystems/f2fs.txt
@@ -157,6 +157,8 @@ data_flush             Enable data flushing before checkpoint in order to
 mode=%s                Control block allocation mode which supports "adaptive"
                        and "lfs". In "lfs" mode, there should be no random
                        writes towards main area.
+io_bits=%u             Set the bit size of write IO requests. It should be set
+                       with "mode=lfs".
 
 ================================================================================
 DEBUGFS ENTRIES
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 692ff1b5adf5..f3697f97e527 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -101,6 +101,7 @@ enum {
 	Opt_noinline_data,
 	Opt_data_flush,
 	Opt_mode,
+	Opt_io_size_bits,
 	Opt_fault_injection,
 	Opt_lazytime,
 	Opt_nolazytime,
@@ -133,6 +134,7 @@ static match_table_t f2fs_tokens = {
 	{Opt_noinline_data, "noinline_data"},
 	{Opt_data_flush, "data_flush"},
 	{Opt_mode, "mode=%s"},
+	{Opt_io_size_bits, "io_bits=%u"},
 	{Opt_fault_injection, "fault_injection=%u"},
 	{Opt_lazytime, "lazytime"},
 	{Opt_nolazytime, "nolazytime"},
@@ -535,6 +537,17 @@ static int parse_options(struct super_block *sb, char *options)
 			}
 			kfree(name);
 			break;
+		case Opt_io_size_bits:
+			if (args->from && match_int(args, &arg))
+				return -EINVAL;
+			if (arg > __ilog2_u32(BIO_MAX_PAGES)) {
+				f2fs_msg(sb, KERN_WARNING,
+					"Not support %d, larger than %d",
+					1 << arg, BIO_MAX_PAGES);
+				return -EINVAL;
+			}
+			sbi->write_io_size_bits = arg;
+			break;
 		case Opt_fault_injection:
 			if (args->from && match_int(args, &arg))
 				return -EINVAL;
@@ -558,6 +571,13 @@ static int parse_options(struct super_block *sb, char *options)
 			return -EINVAL;
 		}
 	}
+
+	if (F2FS_IO_SIZE_BITS(sbi) && !test_opt(sbi, LFS)) {
+		f2fs_msg(sb, KERN_ERR,
+				"Should set mode=lfs with %uKB-sized IO",
+				F2FS_IO_SIZE_KB(sbi));
+		return -EINVAL;
+	}
 	return 0;
 }
 
@@ -918,6 +938,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 	else if (test_opt(sbi, LFS))
 		seq_puts(seq, "lfs");
 	seq_printf(seq, ",active_logs=%u", sbi->active_logs);
+	if (F2FS_IO_SIZE_BITS(sbi))
+		seq_printf(seq, ",io_size=%uKB", F2FS_IO_SIZE_KB(sbi));
 
 	return 0;
 }
-- 
2.11.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 05/10] f2fs: get io size bit from mount option
Date: Fri, 30 Dec 2016 10:51:12 -0800	[thread overview]
Message-ID: <20161230185117.3832-5-jaegeuk@kernel.org> (raw)
In-Reply-To: <20161230185117.3832-1-jaegeuk@kernel.org>

This patch adds to set io_size_bits from mount option.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 Documentation/filesystems/f2fs.txt |  2 ++
 fs/f2fs/super.c                    | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt
index 753dd4f96afe..d99faced79cb 100644
--- a/Documentation/filesystems/f2fs.txt
+++ b/Documentation/filesystems/f2fs.txt
@@ -157,6 +157,8 @@ data_flush             Enable data flushing before checkpoint in order to
 mode=%s                Control block allocation mode which supports "adaptive"
                        and "lfs". In "lfs" mode, there should be no random
                        writes towards main area.
+io_bits=%u             Set the bit size of write IO requests. It should be set
+                       with "mode=lfs".
 
 ================================================================================
 DEBUGFS ENTRIES
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 692ff1b5adf5..f3697f97e527 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -101,6 +101,7 @@ enum {
 	Opt_noinline_data,
 	Opt_data_flush,
 	Opt_mode,
+	Opt_io_size_bits,
 	Opt_fault_injection,
 	Opt_lazytime,
 	Opt_nolazytime,
@@ -133,6 +134,7 @@ static match_table_t f2fs_tokens = {
 	{Opt_noinline_data, "noinline_data"},
 	{Opt_data_flush, "data_flush"},
 	{Opt_mode, "mode=%s"},
+	{Opt_io_size_bits, "io_bits=%u"},
 	{Opt_fault_injection, "fault_injection=%u"},
 	{Opt_lazytime, "lazytime"},
 	{Opt_nolazytime, "nolazytime"},
@@ -535,6 +537,17 @@ static int parse_options(struct super_block *sb, char *options)
 			}
 			kfree(name);
 			break;
+		case Opt_io_size_bits:
+			if (args->from && match_int(args, &arg))
+				return -EINVAL;
+			if (arg > __ilog2_u32(BIO_MAX_PAGES)) {
+				f2fs_msg(sb, KERN_WARNING,
+					"Not support %d, larger than %d",
+					1 << arg, BIO_MAX_PAGES);
+				return -EINVAL;
+			}
+			sbi->write_io_size_bits = arg;
+			break;
 		case Opt_fault_injection:
 			if (args->from && match_int(args, &arg))
 				return -EINVAL;
@@ -558,6 +571,13 @@ static int parse_options(struct super_block *sb, char *options)
 			return -EINVAL;
 		}
 	}
+
+	if (F2FS_IO_SIZE_BITS(sbi) && !test_opt(sbi, LFS)) {
+		f2fs_msg(sb, KERN_ERR,
+				"Should set mode=lfs with %uKB-sized IO",
+				F2FS_IO_SIZE_KB(sbi));
+		return -EINVAL;
+	}
 	return 0;
 }
 
@@ -918,6 +938,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 	else if (test_opt(sbi, LFS))
 		seq_puts(seq, "lfs");
 	seq_printf(seq, ",active_logs=%u", sbi->active_logs);
+	if (F2FS_IO_SIZE_BITS(sbi))
+		seq_printf(seq, ",io_size=%uKB", F2FS_IO_SIZE_KB(sbi));
 
 	return 0;
 }
-- 
2.11.0

  parent reply	other threads:[~2016-12-30 18:51 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30 18:51 [PATCH 01/10] f2fs: reassign new segment for mode=lfs Jaegeuk Kim
2016-12-30 18:51 ` [PATCH 02/10] f2fs: fix wrong tracepoints for op and op_flags Jaegeuk Kim
2017-01-04  3:25   ` Chao Yu
2017-01-04  3:25     ` [f2fs-dev] " Chao Yu
2016-12-30 18:51 ` [PATCH 03/10] f2fs: add submit_bio tracepoint Jaegeuk Kim
2016-12-30 18:51   ` Jaegeuk Kim
2017-01-04  3:32   ` [f2fs-dev] " Chao Yu
2017-01-04  3:32     ` Chao Yu
2017-01-04 23:35   ` [PATCH 03/10 v2] " Jaegeuk Kim
2017-01-12 11:07     ` Chao Yu
2017-01-12 11:07       ` Chao Yu
2017-01-12 11:07       ` Chao Yu
2016-12-30 18:51 ` [PATCH 04/10] f2fs: support IO alignment for DATA and NODE writes Jaegeuk Kim
2016-12-30 18:51   ` Jaegeuk Kim
2017-01-04  8:23   ` [f2fs-dev] " Chao Yu
2017-01-04  8:23     ` Chao Yu
2017-01-04 23:44     ` Jaegeuk Kim
2017-01-04 23:44       ` [f2fs-dev] " Jaegeuk Kim
2017-01-12 11:15       ` Chao Yu
2017-01-12 11:15         ` Chao Yu
2016-12-30 18:51 ` Jaegeuk Kim [this message]
2016-12-30 18:51   ` [PATCH 05/10] f2fs: get io size bit from mount option Jaegeuk Kim
2016-12-30 18:51 ` [PATCH 06/10] f2fs: show the max number of atomic operations Jaegeuk Kim
2016-12-30 18:51   ` Jaegeuk Kim
2017-01-04  8:45   ` Chao Yu
2017-01-04  8:45     ` Chao Yu
2017-01-04 23:50   ` [PATCH 06/10 v2] " Jaegeuk Kim
2017-01-12 11:15     ` Chao Yu
2017-01-12 11:15       ` Chao Yu
2017-01-12 11:15       ` Chao Yu
2016-12-30 18:51 ` [PATCH 07/10] f2fs: don't allow encrypted operations without keys Jaegeuk Kim
2016-12-30 18:51   ` Jaegeuk Kim
2017-01-04  8:56   ` Chao Yu
2017-01-04  8:56     ` [f2fs-dev] " Chao Yu
2016-12-30 18:51 ` [PATCH 08/10] f2fs: relax async discard commands more Jaegeuk Kim
2016-12-30 18:51   ` Jaegeuk Kim
2017-01-04  9:29   ` [f2fs-dev] " Chao Yu
2017-01-04  9:29     ` Chao Yu
2017-01-05  3:19     ` Chao Yu
2017-01-05  3:19       ` Chao Yu
2017-01-05  8:17       ` Chao Yu
2017-01-05  8:17         ` [f2fs-dev] " Chao Yu
2017-01-05 19:59         ` Jaegeuk Kim
2017-01-05 19:59           ` [f2fs-dev] " Jaegeuk Kim
2017-01-05 19:46       ` Jaegeuk Kim
2017-01-06  2:06         ` Chao Yu
2017-01-06  2:06           ` Chao Yu
2017-01-06  2:42           ` Jaegeuk Kim
2017-01-06  2:42             ` [f2fs-dev] " Jaegeuk Kim
2017-01-06  3:32             ` Chao Yu
2017-01-06  3:32               ` Chao Yu
2017-02-22  7:23             ` Chao Yu
2017-02-22  7:23               ` Chao Yu
2017-02-22  7:23               ` Chao Yu
2017-02-22 21:15               ` Jaegeuk Kim
2017-02-22 21:15                 ` [f2fs-dev] " Jaegeuk Kim
2017-02-23  2:08                 ` Chao Yu
2017-02-23  2:08                   ` [f2fs-dev] " Chao Yu
2017-02-23  2:42                   ` Jaegeuk Kim
2017-02-23  2:42                     ` [f2fs-dev] " Jaegeuk Kim
2016-12-30 18:51 ` [PATCH 09/10] f2fs: avoid needless checkpoint in f2fs_trim_fs Jaegeuk Kim
2016-12-30 18:51   ` Jaegeuk Kim
2017-02-22  7:23   ` Chao Yu
2017-02-22  7:23     ` [f2fs-dev] " Chao Yu
2016-12-30 18:51 ` [PATCH 10/10] f2fs: return fs_trim if there is no candidate Jaegeuk Kim
2016-12-30 18:51   ` Jaegeuk Kim
2017-02-22  7:23   ` Chao Yu
2017-02-22  7:23     ` [f2fs-dev] " Chao Yu
2017-02-22 21:26     ` Jaegeuk Kim
2017-02-22 21:26       ` [f2fs-dev] " Jaegeuk Kim
2017-02-23  2:12       ` Chao Yu
2017-02-23  2:12         ` [f2fs-dev] " Chao Yu
2017-02-23  2:47         ` Jaegeuk Kim
2017-02-23  2:47           ` [f2fs-dev] " Jaegeuk Kim
2017-01-04  3:24 ` [f2fs-dev] [PATCH 01/10] f2fs: reassign new segment for mode=lfs Chao Yu
2017-01-04  3:24   ` Chao Yu
2017-01-04 22:48   ` Jaegeuk Kim
2017-01-12 11:03     ` Chao Yu
2017-01-12 11:03       ` 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=20161230185117.3832-5-jaegeuk@kernel.org \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.