Skip to contentSkip to conversation

f2fs: rename checkpoint=merge mount option to checkpoint_merge

PATCH Superseded Daeho Jeong 3 participants 7 messages Feb 2, 2021

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 f2fs: rename checkpoint=merge mount option to checkpoint_merge

From: Daeho Jeong <[email protected]>

As checkpoint=merge comes in, mount option setting related to checkpoint had been mixed up and it became hard to understand. So, I separated this option from "checkpoint=" and made another mount option "checkpoint_merge" for this.

---
v2: renamed "checkpoint=merge" to "checkpoint_merge"

---
 Documentation/filesystems/f2fs.rst |  6 +++---
 fs/f2fs/super.c                    | 26 ++++++++++++++------------
 2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/filesystems/f2fs.rst +3 -3
index d0ead45dc706..475994ed8b15 100644
@@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]]	 Set to "disable" to turn off checkpointing. Set to "enabl
 			 hide up to all remaining free space. The actual space that
 			 would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
 			 This space is reclaimed once checkpoint=enable.
-			 Here is another option "merge", which creates a kernel daemon
-			 and makes it to merge concurrent checkpoint requests as much
-			 as possible to eliminate redundant checkpoint issues. Plus,
+checkpoint_merge	 When checkpoint is enabled, this can be used to create a kernel
+			 daemon and make it to merge concurrent checkpoint requests as
+			 much as possible to eliminate redundant checkpoint issues. Plus,
 			 we can eliminate the sluggish issue caused by slow checkpoint
 			 operation when the checkpoint is done in a process context in
 			 a cgroup having low i/o budget and cpu shares. To make this
fs/f2fs/super.c +14 -12
index 56696f6cfa86..d8603e6c4916 100644
@@ -145,6 +145,7 @@ enum {
 	Opt_checkpoint_disable_cap_perc,
 	Opt_checkpoint_enable,
 	Opt_checkpoint_merge,
+	Opt_nocheckpoint_merge,
 	Opt_compress_algorithm,
 	Opt_compress_log_size,
 	Opt_compress_extension,
@@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = {
 	{Opt_checkpoint_disable_cap, "checkpoint=disable:%u"},
 	{Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"},
 	{Opt_checkpoint_enable, "checkpoint=enable"},
-	{Opt_checkpoint_merge, "checkpoint=merge"},
+	{Opt_checkpoint_merge, "checkpoint_merge"},
+	{Opt_nocheckpoint_merge, "nocheckpoint_merge"},
 	{Opt_compress_algorithm, "compress_algorithm=%s"},
 	{Opt_compress_log_size, "compress_log_size=%u"},
 	{Opt_compress_extension, "compress_extension=%s"},
@@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
 		case Opt_checkpoint_merge:
 			set_opt(sbi, MERGE_CHECKPOINT);
 			break;
+		case Opt_nocheckpoint_merge:
+			clear_opt(sbi, MERGE_CHECKPOINT);
+			break;
 #ifdef CONFIG_F2FS_FS_COMPRESSION
 		case Opt_compress_algorithm:
 			if (!f2fs_sb_has_compression(sbi)) {
@@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
 		return -EINVAL;
 	}
 
-	if (test_opt(sbi, DISABLE_CHECKPOINT) &&
-			test_opt(sbi, MERGE_CHECKPOINT)) {
-		f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n");
-		return -EINVAL;
-	}
-
 	/* Not pass down write hints if the number of active logs is lesser
 	 * than NR_CURSEG_PERSIST_TYPE.
 	 */
@@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 		seq_printf(seq, ",checkpoint=disable:%u",
 				F2FS_OPTION(sbi).unusable_cap);
 	if (test_opt(sbi, MERGE_CHECKPOINT))
-		seq_puts(seq, ",checkpoint=merge");
+		seq_puts(seq, ",checkpoint_merge");
 	if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX)
 		seq_printf(seq, ",fsync_mode=%s", "posix");
 	else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
@@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi)
 	sbi->sb->s_flags |= SB_LAZYTIME;
 	set_opt(sbi, FLUSH_MERGE);
 	set_opt(sbi, DISCARD);
+	clear_opt(sbi, MERGE_CHECKPOINT);
 	if (f2fs_sb_has_blkzoned(sbi))
 		F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
 	else
@@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
 		}
 	}
 
-	if (!test_opt(sbi, MERGE_CHECKPOINT)) {
-		f2fs_stop_ckpt_thread(sbi);
-	} else {
+	if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+			test_opt(sbi, MERGE_CHECKPOINT)) {
 		err = f2fs_start_ckpt_thread(sbi);
 		if (err) {
 			f2fs_err(sbi,
@@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
 			    err);
 			goto restore_gc;
 		}
+	} else {
+		f2fs_stop_ckpt_thread(sbi);
 	}
 
 	/*
@@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
 	/* setup checkpoint request control and start checkpoint issue thread */
 	f2fs_init_ckpt_req_control(sbi);
-	if (test_opt(sbi, MERGE_CHECKPOINT)) {
+	if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+			test_opt(sbi, MERGE_CHECKPOINT)) {
 		err = f2fs_start_ckpt_thread(sbi);
 		if (err) {
 			f2fs_err(sbi,
Signature · 8 lines
2.30.0.365.g02bc693789-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer
#1 lore raw
Quoted 6 lines · Daeho Jeong

From: Daeho Jeong <[email protected]>

As checkpoint=merge comes in, mount option setting related to checkpoint had been mixed up and it became hard to understand. So, I separated this option from "checkpoint=" and made another mount option "checkpoint_merge" for this.

Thanks, merged to the original patch.

Quoted 128 lines

---
v2: renamed "checkpoint=merge" to "checkpoint_merge"

---
 Documentation/filesystems/f2fs.rst |  6 +++---
 fs/f2fs/super.c                    | 26 ++++++++++++++------------
 2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/filesystems/f2fs.rst +3 -3
index d0ead45dc706..475994ed8b15 100644
@@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]]	 Set to "disable" to turn off checkpointing. Set to "enabl
 			 hide up to all remaining free space. The actual space that
 			 would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
 			 This space is reclaimed once checkpoint=enable.
-			 Here is another option "merge", which creates a kernel daemon
-			 and makes it to merge concurrent checkpoint requests as much
-			 as possible to eliminate redundant checkpoint issues. Plus,
+checkpoint_merge	 When checkpoint is enabled, this can be used to create a kernel
+			 daemon and make it to merge concurrent checkpoint requests as
+			 much as possible to eliminate redundant checkpoint issues. Plus,
 			 we can eliminate the sluggish issue caused by slow checkpoint
 			 operation when the checkpoint is done in a process context in
 			 a cgroup having low i/o budget and cpu shares. To make this
fs/f2fs/super.c +14 -12
index 56696f6cfa86..d8603e6c4916 100644
@@ -145,6 +145,7 @@ enum {
 	Opt_checkpoint_disable_cap_perc,
 	Opt_checkpoint_enable,
 	Opt_checkpoint_merge,
+	Opt_nocheckpoint_merge,
 	Opt_compress_algorithm,
 	Opt_compress_log_size,
 	Opt_compress_extension,
@@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = {
 	{Opt_checkpoint_disable_cap, "checkpoint=disable:%u"},
 	{Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"},
 	{Opt_checkpoint_enable, "checkpoint=enable"},
-	{Opt_checkpoint_merge, "checkpoint=merge"},
+	{Opt_checkpoint_merge, "checkpoint_merge"},
+	{Opt_nocheckpoint_merge, "nocheckpoint_merge"},
 	{Opt_compress_algorithm, "compress_algorithm=%s"},
 	{Opt_compress_log_size, "compress_log_size=%u"},
 	{Opt_compress_extension, "compress_extension=%s"},
@@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
 		case Opt_checkpoint_merge:
 			set_opt(sbi, MERGE_CHECKPOINT);
 			break;
+		case Opt_nocheckpoint_merge:
+			clear_opt(sbi, MERGE_CHECKPOINT);
+			break;
 #ifdef CONFIG_F2FS_FS_COMPRESSION
 		case Opt_compress_algorithm:
 			if (!f2fs_sb_has_compression(sbi)) {
@@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
 		return -EINVAL;
 	}
 
-	if (test_opt(sbi, DISABLE_CHECKPOINT) &&
-			test_opt(sbi, MERGE_CHECKPOINT)) {
-		f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n");
-		return -EINVAL;
-	}
-
 	/* Not pass down write hints if the number of active logs is lesser
 	 * than NR_CURSEG_PERSIST_TYPE.
 	 */
@@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 		seq_printf(seq, ",checkpoint=disable:%u",
 				F2FS_OPTION(sbi).unusable_cap);
 	if (test_opt(sbi, MERGE_CHECKPOINT))
-		seq_puts(seq, ",checkpoint=merge");
+		seq_puts(seq, ",checkpoint_merge");
 	if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX)
 		seq_printf(seq, ",fsync_mode=%s", "posix");
 	else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
@@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi)
 	sbi->sb->s_flags |= SB_LAZYTIME;
 	set_opt(sbi, FLUSH_MERGE);
 	set_opt(sbi, DISCARD);
+	clear_opt(sbi, MERGE_CHECKPOINT);
 	if (f2fs_sb_has_blkzoned(sbi))
 		F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
 	else
@@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
 		}
 	}
 
-	if (!test_opt(sbi, MERGE_CHECKPOINT)) {
-		f2fs_stop_ckpt_thread(sbi);
-	} else {
+	if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+			test_opt(sbi, MERGE_CHECKPOINT)) {
 		err = f2fs_start_ckpt_thread(sbi);
 		if (err) {
 			f2fs_err(sbi,
@@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
 			    err);
 			goto restore_gc;
 		}
+	} else {
+		f2fs_stop_ckpt_thread(sbi);
 	}
 
 	/*
@@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
 	/* setup checkpoint request control and start checkpoint issue thread */
 	f2fs_init_ckpt_req_control(sbi);
-	if (test_opt(sbi, MERGE_CHECKPOINT)) {
+	if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+			test_opt(sbi, MERGE_CHECKPOINT)) {
 		err = f2fs_start_ckpt_thread(sbi);
 		if (err) {
 			f2fs_err(sbi,
Signature · 8 lines
2.30.0.365.g02bc693789-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw
In reply to Daeho Jeong
Quoted 78 lines · Daeho Jeong

From: Daeho Jeong <[email protected]>

As checkpoint=merge comes in, mount option setting related to checkpoint had been mixed up and it became hard to understand. So, I separated this option from "checkpoint=" and made another mount option "checkpoint_merge" for this.

---
v2: renamed "checkpoint=merge" to "checkpoint_merge"

---
  Documentation/filesystems/f2fs.rst |  6 +++---
  fs/f2fs/super.c                    | 26 ++++++++++++++------------
  2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/filesystems/f2fs.rst +3 -3
index d0ead45dc706..475994ed8b15 100644
@@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]]	 Set to "disable" to turn off checkpointing. Set to "enabl
  			 hide up to all remaining free space. The actual space that
  			 would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
  			 This space is reclaimed once checkpoint=enable.
-			 Here is another option "merge", which creates a kernel daemon
-			 and makes it to merge concurrent checkpoint requests as much
-			 as possible to eliminate redundant checkpoint issues. Plus,
+checkpoint_merge	 When checkpoint is enabled, this can be used to create a kernel
+			 daemon and make it to merge concurrent checkpoint requests as
+			 much as possible to eliminate redundant checkpoint issues. Plus,
  			 we can eliminate the sluggish issue caused by slow checkpoint
  			 operation when the checkpoint is done in a process context in
  			 a cgroup having low i/o budget and cpu shares. To make this
fs/f2fs/super.c +6 -7
index 56696f6cfa86..d8603e6c4916 100644
@@ -145,6 +145,7 @@ enum {
  	Opt_checkpoint_disable_cap_perc,
  	Opt_checkpoint_enable,
  	Opt_checkpoint_merge,
+	Opt_nocheckpoint_merge,
  	Opt_compress_algorithm,
  	Opt_compress_log_size,
  	Opt_compress_extension,
@@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = {
  	{Opt_checkpoint_disable_cap, "checkpoint=disable:%u"},
  	{Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"},
  	{Opt_checkpoint_enable, "checkpoint=enable"},
-	{Opt_checkpoint_merge, "checkpoint=merge"},
+	{Opt_checkpoint_merge, "checkpoint_merge"},
+	{Opt_nocheckpoint_merge, "nocheckpoint_merge"},
  	{Opt_compress_algorithm, "compress_algorithm=%s"},
  	{Opt_compress_log_size, "compress_log_size=%u"},
  	{Opt_compress_extension, "compress_extension=%s"},
@@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
  		case Opt_checkpoint_merge:
  			set_opt(sbi, MERGE_CHECKPOINT);
  			break;
+		case Opt_nocheckpoint_merge:
+			clear_opt(sbi, MERGE_CHECKPOINT);
+			break;
  #ifdef CONFIG_F2FS_FS_COMPRESSION
  		case Opt_compress_algorithm:
  			if (!f2fs_sb_has_compression(sbi)) {
@@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
  		return -EINVAL;
  	}
 
-	if (test_opt(sbi, DISABLE_CHECKPOINT) &&
-			test_opt(sbi, MERGE_CHECKPOINT)) {
-		f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n");
-		return -EINVAL;
-	}
-
  	/* Not pass down write hints if the number of active logs is lesser
  	 * than NR_CURSEG_PERSIST_TYPE.
  	 */

fs/f2fs/super.c static int f2fs_show_options(struct seq_file *seq, struct dentry *root) · line 1784

Quoted 5 lines
fs/f2fs/super.c +1 -1
@@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
  		seq_printf(seq, ",checkpoint=disable:%u",
  				F2FS_OPTION(sbi).unusable_cap);
  	if (test_opt(sbi, MERGE_CHECKPOINT))
-		seq_puts(seq, ",checkpoint=merge");
+		seq_puts(seq, ",checkpoint_merge");

Other noxxx options will be shown in show_options(), how about following them?

fs/f2fs/super.c static void default_options(struct f2fs_sb_info *sbi) · line 1829

Quoted 8 lines
fs/f2fs/super.c +1 -0
  	if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX)
  		seq_printf(seq, ",fsync_mode=%s", "posix");
  	else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
@@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi)
  	sbi->sb->s_flags |= SB_LAZYTIME;
  	set_opt(sbi, FLUSH_MERGE);
  	set_opt(sbi, DISCARD);
+	clear_opt(sbi, MERGE_CHECKPOINT);

Why should we clear checkpoint_merge option in default_options()?

Thanks,

Quoted 26 lines
fs/f2fs/super.c +4 -3
  	if (f2fs_sb_has_blkzoned(sbi))
  		F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
  	else
@@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
  		}
  	}
 
-	if (!test_opt(sbi, MERGE_CHECKPOINT)) {
-		f2fs_stop_ckpt_thread(sbi);
-	} else {
+	if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+			test_opt(sbi, MERGE_CHECKPOINT)) {
  		err = f2fs_start_ckpt_thread(sbi);
  		if (err) {
  			f2fs_err(sbi,
@@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
  			    err);
  			goto restore_gc;
  		}
+	} else {
+		f2fs_stop_ckpt_thread(sbi);
  	}
 
  	/*

fs/f2fs/super.c static int f2fs_fill_super(struct super_block *sb, void *data, int silent) · line 3839

Quoted 9 lines
fs/f2fs/super.c +2 -1
@@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
  	/* setup checkpoint request control and start checkpoint issue thread */
  	f2fs_init_ckpt_req_control(sbi);
-	if (test_opt(sbi, MERGE_CHECKPOINT)) {
+	if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+			test_opt(sbi, MERGE_CHECKPOINT)) {
  		err = f2fs_start_ckpt_thread(sbi);
  		if (err) {
  			f2fs_err(sbi,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#3 lore raw

I chose the same step with "flush_merge", because it doesn't have "noflush_merge".
Do you think we need that for both, "noflush_merge" and "nocheckpoint_merge"?

I thought we needed to give some time to make this be turned on by default. It might be a little radical. :)

What do you think?

2021년 2월 2일 (화) 오후 4:40, Chao Yu <[email protected]>님이 작성:

Quoted 127 lines · Daeho Jeong
Quoted 78 lines

From: Daeho Jeong <[email protected]>

As checkpoint=merge comes in, mount option setting related to checkpoint had been mixed up and it became hard to understand. So, I separated this option from "checkpoint=" and made another mount option "checkpoint_merge" for this.

---
v2: renamed "checkpoint=merge" to "checkpoint_merge"

---
  Documentation/filesystems/f2fs.rst |  6 +++---
  fs/f2fs/super.c                    | 26 ++++++++++++++------------
  2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/filesystems/f2fs.rst +3 -3
index d0ead45dc706..475994ed8b15 100644
@@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]]      Set to "disable" to turn off checkpointing. Set to "enabl
                       hide up to all remaining free space. The actual space that
                       would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
                       This space is reclaimed once checkpoint=enable.
-                      Here is another option "merge", which creates a kernel daemon
-                      and makes it to merge concurrent checkpoint requests as much
-                      as possible to eliminate redundant checkpoint issues. Plus,
+checkpoint_merge      When checkpoint is enabled, this can be used to create a kernel
+                      daemon and make it to merge concurrent checkpoint requests as
+                      much as possible to eliminate redundant checkpoint issues. Plus,
                       we can eliminate the sluggish issue caused by slow checkpoint
                       operation when the checkpoint is done in a process context in
                       a cgroup having low i/o budget and cpu shares. To make this
fs/f2fs/super.c +6 -7
index 56696f6cfa86..d8603e6c4916 100644
@@ -145,6 +145,7 @@ enum {
      Opt_checkpoint_disable_cap_perc,
      Opt_checkpoint_enable,
      Opt_checkpoint_merge,
+     Opt_nocheckpoint_merge,
      Opt_compress_algorithm,
      Opt_compress_log_size,
      Opt_compress_extension,
@@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = {
      {Opt_checkpoint_disable_cap, "checkpoint=disable:%u"},
      {Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"},
      {Opt_checkpoint_enable, "checkpoint=enable"},
-     {Opt_checkpoint_merge, "checkpoint=merge"},
+     {Opt_checkpoint_merge, "checkpoint_merge"},
+     {Opt_nocheckpoint_merge, "nocheckpoint_merge"},
      {Opt_compress_algorithm, "compress_algorithm=%s"},
      {Opt_compress_log_size, "compress_log_size=%u"},
      {Opt_compress_extension, "compress_extension=%s"},
@@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
              case Opt_checkpoint_merge:
                      set_opt(sbi, MERGE_CHECKPOINT);
                      break;
+             case Opt_nocheckpoint_merge:
+                     clear_opt(sbi, MERGE_CHECKPOINT);
+                     break;
  #ifdef CONFIG_F2FS_FS_COMPRESSION
              case Opt_compress_algorithm:
                      if (!f2fs_sb_has_compression(sbi)) {
@@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
              return -EINVAL;
      }
 
-     if (test_opt(sbi, DISABLE_CHECKPOINT) &&
-                     test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n");
-             return -EINVAL;
-     }
-
      /* Not pass down write hints if the number of active logs is lesser
       * than NR_CURSEG_PERSIST_TYPE.
       */

fs/f2fs/super.c static int f2fs_show_options(struct seq_file *seq, struct dentry *root) · line 1784

Quoted 5 lines
fs/f2fs/super.c +1 -1
@@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
              seq_printf(seq, ",checkpoint=disable:%u",
                              F2FS_OPTION(sbi).unusable_cap);
      if (test_opt(sbi, MERGE_CHECKPOINT))
-             seq_puts(seq, ",checkpoint=merge");
+             seq_puts(seq, ",checkpoint_merge");

Other noxxx options will be shown in show_options(), how about following them?

fs/f2fs/super.c static void default_options(struct f2fs_sb_info *sbi) · line 1829

Quoted 8 lines
fs/f2fs/super.c +1 -0
      if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX)
              seq_printf(seq, ",fsync_mode=%s", "posix");
      else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
@@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi)
      sbi->sb->s_flags |= SB_LAZYTIME;
      set_opt(sbi, FLUSH_MERGE);
      set_opt(sbi, DISCARD);
+     clear_opt(sbi, MERGE_CHECKPOINT);

Why should we clear checkpoint_merge option in default_options()?

Thanks,

Quoted 26 lines
fs/f2fs/super.c +4 -3
      if (f2fs_sb_has_blkzoned(sbi))
              F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
      else
@@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
              }
      }
 
-     if (!test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_stop_ckpt_thread(sbi);
-     } else {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
              err = f2fs_start_ckpt_thread(sbi);
              if (err) {
                      f2fs_err(sbi,
@@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
                          err);
                      goto restore_gc;
              }
+     } else {
+             f2fs_stop_ckpt_thread(sbi);
      }
 
      /*
@@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
Quoted 9 lines

fs/f2fs/super.c static int f2fs_fill_super(struct super_block *sb, void *data, int silent) · line 3839

Quoted 9 lines
fs/f2fs/super.c +2 -1
      /* setup checkpoint request control and start checkpoint issue thread */
      f2fs_init_ckpt_req_control(sbi);
-     if (test_opt(sbi, MERGE_CHECKPOINT)) {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
              err = f2fs_start_ckpt_thread(sbi);
              if (err) {
                      f2fs_err(sbi,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#4 lore raw
Quoted 2 lines · Daeho Jeong

I chose the same step with "flush_merge", because it doesn't have "noflush_merge".

Oh, "noxxx" option was added only when we set the option by default in default_options(), when user want to disable the default option, it needs to use "noxxx" option, and then we will show this "noxxx" option string to user via show_options() to indicate that "noxxx" option is working now.

Anyway I think we should fix to show "noflush_merge" option because we have set flush_merge by default.

Quoted 1 line

Do you think we need that for both, "noflush_merge" and "nocheckpoint_merge"?

For "nocheckpoint_merge", we can introduce this option only when we want to set "checkpoint_merge" by default.

Here is the example from noinline_data:

Commit 75342797988 ("f2fs: enable inline data by default")

Thanks,

Quoted 134 lines

I thought we needed to give some time to make this be turned on by default. It might be a little radical. :)

What do you think?

2021년 2월 2일 (화) 오후 4:40, Chao Yu <[email protected]>님이 작성:

Quoted 127 lines · Daeho Jeong
Quoted 78 lines

From: Daeho Jeong <[email protected]>

As checkpoint=merge comes in, mount option setting related to checkpoint had been mixed up and it became hard to understand. So, I separated this option from "checkpoint=" and made another mount option "checkpoint_merge" for this.

---
v2: renamed "checkpoint=merge" to "checkpoint_merge"

---
   Documentation/filesystems/f2fs.rst |  6 +++---
   fs/f2fs/super.c                    | 26 ++++++++++++++------------
   2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/filesystems/f2fs.rst +3 -3
index d0ead45dc706..475994ed8b15 100644
@@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]]      Set to "disable" to turn off checkpointing. Set to "enabl
                        hide up to all remaining free space. The actual space that
                        would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
                        This space is reclaimed once checkpoint=enable.
-                      Here is another option "merge", which creates a kernel daemon
-                      and makes it to merge concurrent checkpoint requests as much
-                      as possible to eliminate redundant checkpoint issues. Plus,
+checkpoint_merge      When checkpoint is enabled, this can be used to create a kernel
+                      daemon and make it to merge concurrent checkpoint requests as
+                      much as possible to eliminate redundant checkpoint issues. Plus,
                        we can eliminate the sluggish issue caused by slow checkpoint
                        operation when the checkpoint is done in a process context in
                        a cgroup having low i/o budget and cpu shares. To make this
fs/f2fs/super.c +6 -7
index 56696f6cfa86..d8603e6c4916 100644
@@ -145,6 +145,7 @@ enum {
       Opt_checkpoint_disable_cap_perc,
       Opt_checkpoint_enable,
       Opt_checkpoint_merge,
+     Opt_nocheckpoint_merge,
       Opt_compress_algorithm,
       Opt_compress_log_size,
       Opt_compress_extension,
@@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = {
       {Opt_checkpoint_disable_cap, "checkpoint=disable:%u"},
       {Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"},
       {Opt_checkpoint_enable, "checkpoint=enable"},
-     {Opt_checkpoint_merge, "checkpoint=merge"},
+     {Opt_checkpoint_merge, "checkpoint_merge"},
+     {Opt_nocheckpoint_merge, "nocheckpoint_merge"},
       {Opt_compress_algorithm, "compress_algorithm=%s"},
       {Opt_compress_log_size, "compress_log_size=%u"},
       {Opt_compress_extension, "compress_extension=%s"},
@@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
               case Opt_checkpoint_merge:
                       set_opt(sbi, MERGE_CHECKPOINT);
                       break;
+             case Opt_nocheckpoint_merge:
+                     clear_opt(sbi, MERGE_CHECKPOINT);
+                     break;
   #ifdef CONFIG_F2FS_FS_COMPRESSION
               case Opt_compress_algorithm:
                       if (!f2fs_sb_has_compression(sbi)) {
@@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
               return -EINVAL;
       }
 
-     if (test_opt(sbi, DISABLE_CHECKPOINT) &&
-                     test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n");
-             return -EINVAL;
-     }
-
       /* Not pass down write hints if the number of active logs is lesser
        * than NR_CURSEG_PERSIST_TYPE.
        */

fs/f2fs/super.c static int f2fs_show_options(struct seq_file *seq, struct dentry *root) · line 1784

Quoted 5 lines
fs/f2fs/super.c +1 -1
@@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
               seq_printf(seq, ",checkpoint=disable:%u",
                               F2FS_OPTION(sbi).unusable_cap);
       if (test_opt(sbi, MERGE_CHECKPOINT))
-             seq_puts(seq, ",checkpoint=merge");
+             seq_puts(seq, ",checkpoint_merge");

Other noxxx options will be shown in show_options(), how about following them?

fs/f2fs/super.c static void default_options(struct f2fs_sb_info *sbi) · line 1829

Quoted 8 lines
fs/f2fs/super.c +1 -0
       if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX)
               seq_printf(seq, ",fsync_mode=%s", "posix");
       else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
@@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi)
       sbi->sb->s_flags |= SB_LAZYTIME;
       set_opt(sbi, FLUSH_MERGE);
       set_opt(sbi, DISCARD);
+     clear_opt(sbi, MERGE_CHECKPOINT);

Why should we clear checkpoint_merge option in default_options()?

Thanks,

Quoted 26 lines
fs/f2fs/super.c +4 -3
       if (f2fs_sb_has_blkzoned(sbi))
               F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
       else
@@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
               }
       }
 
-     if (!test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_stop_ckpt_thread(sbi);
-     } else {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
               err = f2fs_start_ckpt_thread(sbi);
               if (err) {
                       f2fs_err(sbi,
@@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
                           err);
                       goto restore_gc;
               }
+     } else {
+             f2fs_stop_ckpt_thread(sbi);
       }
 
       /*
@@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
Quoted 11 lines
Quoted 9 lines

fs/f2fs/super.c static int f2fs_fill_super(struct super_block *sb, void *data, int silent) · line 3839

Quoted 9 lines
fs/f2fs/super.c +2 -1
       /* setup checkpoint request control and start checkpoint issue thread */
       f2fs_init_ckpt_req_control(sbi);
-     if (test_opt(sbi, MERGE_CHECKPOINT)) {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
               err = f2fs_start_ckpt_thread(sbi);
               if (err) {
                       f2fs_err(sbi,

.

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#5 lore raw

If I understand it correctly, the only thing I have to do now is remove "nocheckpoint_merge" now.
Am I correct? :)

2021년 2월 2일 (화) 오후 5:30, Chao Yu <[email protected]>님이 작성:

Quoted 16 lines · Daeho Jeong
Quoted 2 lines

I chose the same step with "flush_merge", because it doesn't have "noflush_merge".

Oh, "noxxx" option was added only when we set the option by default in default_options(), when user want to disable the default option, it needs to use "noxxx" option, and then we will show this "noxxx" option string to user via show_options() to indicate that "noxxx" option is working now.

Anyway I think we should fix to show "noflush_merge" option because we have set flush_merge by default.

Quoted 1 line

Do you think we need that for both, "noflush_merge" and "nocheckpoint_merge"?

Quoted 154 lines

For "nocheckpoint_merge", we can introduce this option only when we want to set "checkpoint_merge" by default.

Here is the example from noinline_data:

Commit 75342797988 ("f2fs: enable inline data by default")

Thanks,

Quoted 145 lines

I thought we needed to give some time to make this be turned on by default. It might be a little radical. :)

What do you think?

2021년 2월 2일 (화) 오후 4:40, Chao Yu <[email protected]>님이 작성:

Quoted 127 lines · Daeho Jeong
Quoted 78 lines

From: Daeho Jeong <[email protected]>

As checkpoint=merge comes in, mount option setting related to checkpoint had been mixed up and it became hard to understand. So, I separated this option from "checkpoint=" and made another mount option "checkpoint_merge" for this.

---
v2: renamed "checkpoint=merge" to "checkpoint_merge"

---
   Documentation/filesystems/f2fs.rst |  6 +++---
   fs/f2fs/super.c                    | 26 ++++++++++++++------------
   2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/filesystems/f2fs.rst +3 -3
index d0ead45dc706..475994ed8b15 100644
@@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]]      Set to "disable" to turn off checkpointing. Set to "enabl
                        hide up to all remaining free space. The actual space that
                        would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
                        This space is reclaimed once checkpoint=enable.
-                      Here is another option "merge", which creates a kernel daemon
-                      and makes it to merge concurrent checkpoint requests as much
-                      as possible to eliminate redundant checkpoint issues. Plus,
+checkpoint_merge      When checkpoint is enabled, this can be used to create a kernel
+                      daemon and make it to merge concurrent checkpoint requests as
+                      much as possible to eliminate redundant checkpoint issues. Plus,
                        we can eliminate the sluggish issue caused by slow checkpoint
                        operation when the checkpoint is done in a process context in
                        a cgroup having low i/o budget and cpu shares. To make this
fs/f2fs/super.c +6 -7
index 56696f6cfa86..d8603e6c4916 100644
@@ -145,6 +145,7 @@ enum {
       Opt_checkpoint_disable_cap_perc,
       Opt_checkpoint_enable,
       Opt_checkpoint_merge,
+     Opt_nocheckpoint_merge,
       Opt_compress_algorithm,
       Opt_compress_log_size,
       Opt_compress_extension,
@@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = {
       {Opt_checkpoint_disable_cap, "checkpoint=disable:%u"},
       {Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"},
       {Opt_checkpoint_enable, "checkpoint=enable"},
-     {Opt_checkpoint_merge, "checkpoint=merge"},
+     {Opt_checkpoint_merge, "checkpoint_merge"},
+     {Opt_nocheckpoint_merge, "nocheckpoint_merge"},
       {Opt_compress_algorithm, "compress_algorithm=%s"},
       {Opt_compress_log_size, "compress_log_size=%u"},
       {Opt_compress_extension, "compress_extension=%s"},
@@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
               case Opt_checkpoint_merge:
                       set_opt(sbi, MERGE_CHECKPOINT);
                       break;
+             case Opt_nocheckpoint_merge:
+                     clear_opt(sbi, MERGE_CHECKPOINT);
+                     break;
   #ifdef CONFIG_F2FS_FS_COMPRESSION
               case Opt_compress_algorithm:
                       if (!f2fs_sb_has_compression(sbi)) {
@@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
               return -EINVAL;
       }
 
-     if (test_opt(sbi, DISABLE_CHECKPOINT) &&
-                     test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n");
-             return -EINVAL;
-     }
-
       /* Not pass down write hints if the number of active logs is lesser
        * than NR_CURSEG_PERSIST_TYPE.
        */

fs/f2fs/super.c static int f2fs_show_options(struct seq_file *seq, struct dentry *root) · line 1784

Quoted 5 lines
fs/f2fs/super.c +1 -1
@@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
               seq_printf(seq, ",checkpoint=disable:%u",
                               F2FS_OPTION(sbi).unusable_cap);
       if (test_opt(sbi, MERGE_CHECKPOINT))
-             seq_puts(seq, ",checkpoint=merge");
+             seq_puts(seq, ",checkpoint_merge");

Other noxxx options will be shown in show_options(), how about following them?

fs/f2fs/super.c static void default_options(struct f2fs_sb_info *sbi) · line 1829

Quoted 8 lines
fs/f2fs/super.c +1 -0
       if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX)
               seq_printf(seq, ",fsync_mode=%s", "posix");
       else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
@@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi)
       sbi->sb->s_flags |= SB_LAZYTIME;
       set_opt(sbi, FLUSH_MERGE);
       set_opt(sbi, DISCARD);
+     clear_opt(sbi, MERGE_CHECKPOINT);

Why should we clear checkpoint_merge option in default_options()?

Thanks,

Quoted 26 lines
fs/f2fs/super.c +4 -3
       if (f2fs_sb_has_blkzoned(sbi))
               F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
       else
@@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
               }
       }
 
-     if (!test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_stop_ckpt_thread(sbi);
-     } else {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
               err = f2fs_start_ckpt_thread(sbi);
               if (err) {
                       f2fs_err(sbi,
@@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
                           err);
                       goto restore_gc;
               }
+     } else {
+             f2fs_stop_ckpt_thread(sbi);
       }
 
       /*
@@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
Quoted 9 lines

fs/f2fs/super.c static int f2fs_fill_super(struct super_block *sb, void *data, int silent) · line 3839

Quoted 9 lines
fs/f2fs/super.c +2 -1
       /* setup checkpoint request control and start checkpoint issue thread */
       f2fs_init_ckpt_req_control(sbi);
-     if (test_opt(sbi, MERGE_CHECKPOINT)) {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
               err = f2fs_start_ckpt_thread(sbi);
               if (err) {
                       f2fs_err(sbi,

.

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#6 lore raw
Quoted 3 lines · Daeho Jeong

If I understand it correctly, the only thing I have to do now is remove "nocheckpoint_merge" now.
Am I correct? :)

For this patch, Yup. :)

Thanks,

Quoted 172 lines

2021년 2월 2일 (화) 오후 5:30, Chao Yu <[email protected]>님이 작성:

Quoted 16 lines · Daeho Jeong
Quoted 2 lines

I chose the same step with "flush_merge", because it doesn't have "noflush_merge".

Oh, "noxxx" option was added only when we set the option by default in default_options(), when user want to disable the default option, it needs to use "noxxx" option, and then we will show this "noxxx" option string to user via show_options() to indicate that "noxxx" option is working now.

Anyway I think we should fix to show "noflush_merge" option because we have set flush_merge by default.

Quoted 1 line

Do you think we need that for both, "noflush_merge" and "nocheckpoint_merge"?

Quoted 154 lines

For "nocheckpoint_merge", we can introduce this option only when we want to set "checkpoint_merge" by default.

Here is the example from noinline_data:

Commit 75342797988 ("f2fs: enable inline data by default")

Thanks,

Quoted 145 lines

I thought we needed to give some time to make this be turned on by default. It might be a little radical. :)

What do you think?

2021년 2월 2일 (화) 오후 4:40, Chao Yu <[email protected]>님이 작성:

Quoted 127 lines · Daeho Jeong
Quoted 78 lines

From: Daeho Jeong <[email protected]>

As checkpoint=merge comes in, mount option setting related to checkpoint had been mixed up and it became hard to understand. So, I separated this option from "checkpoint=" and made another mount option "checkpoint_merge" for this.

---
v2: renamed "checkpoint=merge" to "checkpoint_merge"

---
    Documentation/filesystems/f2fs.rst |  6 +++---
    fs/f2fs/super.c                    | 26 ++++++++++++++------------
    2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/filesystems/f2fs.rst +3 -3
index d0ead45dc706..475994ed8b15 100644
@@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]]      Set to "disable" to turn off checkpointing. Set to "enabl
                         hide up to all remaining free space. The actual space that
                         would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
                         This space is reclaimed once checkpoint=enable.
-                      Here is another option "merge", which creates a kernel daemon
-                      and makes it to merge concurrent checkpoint requests as much
-                      as possible to eliminate redundant checkpoint issues. Plus,
+checkpoint_merge      When checkpoint is enabled, this can be used to create a kernel
+                      daemon and make it to merge concurrent checkpoint requests as
+                      much as possible to eliminate redundant checkpoint issues. Plus,
                         we can eliminate the sluggish issue caused by slow checkpoint
                         operation when the checkpoint is done in a process context in
                         a cgroup having low i/o budget and cpu shares. To make this
fs/f2fs/super.c +6 -7
index 56696f6cfa86..d8603e6c4916 100644
@@ -145,6 +145,7 @@ enum {
        Opt_checkpoint_disable_cap_perc,
        Opt_checkpoint_enable,
        Opt_checkpoint_merge,
+     Opt_nocheckpoint_merge,
        Opt_compress_algorithm,
        Opt_compress_log_size,
        Opt_compress_extension,
@@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = {
        {Opt_checkpoint_disable_cap, "checkpoint=disable:%u"},
        {Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"},
        {Opt_checkpoint_enable, "checkpoint=enable"},
-     {Opt_checkpoint_merge, "checkpoint=merge"},
+     {Opt_checkpoint_merge, "checkpoint_merge"},
+     {Opt_nocheckpoint_merge, "nocheckpoint_merge"},
        {Opt_compress_algorithm, "compress_algorithm=%s"},
        {Opt_compress_log_size, "compress_log_size=%u"},
        {Opt_compress_extension, "compress_extension=%s"},
@@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
                case Opt_checkpoint_merge:
                        set_opt(sbi, MERGE_CHECKPOINT);
                        break;
+             case Opt_nocheckpoint_merge:
+                     clear_opt(sbi, MERGE_CHECKPOINT);
+                     break;
    #ifdef CONFIG_F2FS_FS_COMPRESSION
                case Opt_compress_algorithm:
                        if (!f2fs_sb_has_compression(sbi)) {
@@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
                return -EINVAL;
        }
 
-     if (test_opt(sbi, DISABLE_CHECKPOINT) &&
-                     test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n");
-             return -EINVAL;
-     }
-
        /* Not pass down write hints if the number of active logs is lesser
         * than NR_CURSEG_PERSIST_TYPE.
         */

fs/f2fs/super.c static int f2fs_show_options(struct seq_file *seq, struct dentry *root) · line 1784

Quoted 5 lines
fs/f2fs/super.c +1 -1
@@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
                seq_printf(seq, ",checkpoint=disable:%u",
                                F2FS_OPTION(sbi).unusable_cap);
        if (test_opt(sbi, MERGE_CHECKPOINT))
-             seq_puts(seq, ",checkpoint=merge");
+             seq_puts(seq, ",checkpoint_merge");

Other noxxx options will be shown in show_options(), how about following them?

fs/f2fs/super.c static void default_options(struct f2fs_sb_info *sbi) · line 1829

Quoted 8 lines
fs/f2fs/super.c +1 -0
        if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX)
                seq_printf(seq, ",fsync_mode=%s", "posix");
        else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT)
@@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi)
        sbi->sb->s_flags |= SB_LAZYTIME;
        set_opt(sbi, FLUSH_MERGE);
        set_opt(sbi, DISCARD);
+     clear_opt(sbi, MERGE_CHECKPOINT);

Why should we clear checkpoint_merge option in default_options()?

Thanks,

Quoted 26 lines
fs/f2fs/super.c +4 -3
        if (f2fs_sb_has_blkzoned(sbi))
                F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
        else
@@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
                }
        }
 
-     if (!test_opt(sbi, MERGE_CHECKPOINT)) {
-             f2fs_stop_ckpt_thread(sbi);
-     } else {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
                err = f2fs_start_ckpt_thread(sbi);
                if (err) {
                        f2fs_err(sbi,
@@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
                            err);
                        goto restore_gc;
                }
+     } else {
+             f2fs_stop_ckpt_thread(sbi);
        }
 
        /*
@@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
Quoted 9 lines

fs/f2fs/super.c static int f2fs_fill_super(struct super_block *sb, void *data, int silent) · line 3839

Quoted 9 lines
fs/f2fs/super.c +2 -1
        /* setup checkpoint request control and start checkpoint issue thread */
        f2fs_init_ckpt_req_control(sbi);
-     if (test_opt(sbi, MERGE_CHECKPOINT)) {
+     if (!test_opt(sbi, DISABLE_CHECKPOINT) &&
+                     test_opt(sbi, MERGE_CHECKPOINT)) {
                err = f2fs_start_ckpt_thread(sbi);
                if (err) {
                        f2fs_err(sbi,

.

Quoted 2 lines

.

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel