* [PATCH 1/2] f2fs: remove obsolete whint_mode
@ 2022-04-13 15:49 ` Jaegeuk Kim
0 siblings, 0 replies; 12+ messages in thread
From: Jaegeuk Kim @ 2022-04-13 15:49 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim
This patch removes obsolete whint_mode.
Fixes: commit 41d36a9f3e53 ("fs: remove kiocb.ki_hint")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
Documentation/filesystems/f2fs.rst | 70 ----------------------
fs/f2fs/f2fs.h | 3 -
fs/f2fs/segment.c | 95 ------------------------------
fs/f2fs/super.c | 31 +---------
4 files changed, 1 insertion(+), 198 deletions(-)
diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
index 4a2426f0485a..ad8dc8c040a2 100644
--- a/Documentation/filesystems/f2fs.rst
+++ b/Documentation/filesystems/f2fs.rst
@@ -235,12 +235,6 @@ offgrpjquota Turn off group journalled quota.
offprjjquota Turn off project journalled quota.
quota Enable plain user disk quota accounting.
noquota Disable all plain disk quota option.
-whint_mode=%s Control which write hints are passed down to block
- layer. This supports "off", "user-based", and
- "fs-based". In "off" mode (default), f2fs does not pass
- down hints. In "user-based" mode, f2fs tries to pass
- down hints given by users. And in "fs-based" mode, f2fs
- passes down hints with its policy.
alloc_mode=%s Adjust block allocation policy, which supports "reuse"
and "default".
fsync_mode=%s Control the policy of fsync. Currently supports "posix",
@@ -751,70 +745,6 @@ In order to identify whether the data in the victim segment are valid or not,
F2FS manages a bitmap. Each bit represents the validity of a block, and the
bitmap is composed of a bit stream covering whole blocks in main area.
-Write-hint Policy
------------------
-
-1) whint_mode=off. F2FS only passes down WRITE_LIFE_NOT_SET.
-
-2) whint_mode=user-based. F2FS tries to pass down hints given by
-users.
-
-===================== ======================== ===================
-User F2FS Block
-===================== ======================== ===================
-N/A META WRITE_LIFE_NOT_SET
-N/A HOT_NODE "
-N/A WARM_NODE "
-N/A COLD_NODE "
-ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
-extension list " "
-
--- buffered io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
-WRITE_LIFE_NONE " "
-WRITE_LIFE_MEDIUM " "
-WRITE_LIFE_LONG " "
-
--- direct io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
-WRITE_LIFE_NONE " WRITE_LIFE_NONE
-WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
-WRITE_LIFE_LONG " WRITE_LIFE_LONG
-===================== ======================== ===================
-
-3) whint_mode=fs-based. F2FS passes down hints with its policy.
-
-===================== ======================== ===================
-User F2FS Block
-===================== ======================== ===================
-N/A META WRITE_LIFE_MEDIUM;
-N/A HOT_NODE WRITE_LIFE_NOT_SET
-N/A WARM_NODE "
-N/A COLD_NODE WRITE_LIFE_NONE
-ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
-extension list " "
-
--- buffered io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_LONG
-WRITE_LIFE_NONE " "
-WRITE_LIFE_MEDIUM " "
-WRITE_LIFE_LONG " "
-
--- direct io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
-WRITE_LIFE_NONE " WRITE_LIFE_NONE
-WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
-WRITE_LIFE_LONG " WRITE_LIFE_LONG
-===================== ======================== ===================
-
Fallocate(2) Policy
-------------------
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index f793bbe1e6ce..d76afbb8efdf 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -154,7 +154,6 @@ struct f2fs_mount_info {
int s_jquota_fmt; /* Format of quota to use */
#endif
/* For which write hints are passed down to block layer */
- int whint_mode;
int alloc_mode; /* segment allocation policy */
int fsync_mode; /* fsync policy */
int fs_mode; /* fs mode: LFS or ADAPTIVE */
@@ -3640,8 +3639,6 @@ void f2fs_destroy_segment_manager(struct f2fs_sb_info *sbi);
int __init f2fs_create_segment_manager_caches(void);
void f2fs_destroy_segment_manager_caches(void);
int f2fs_rw_hint_to_seg_type(enum rw_hint hint);
-enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
- enum page_type type, enum temp_type temp);
unsigned int f2fs_usable_segs_in_sec(struct f2fs_sb_info *sbi,
unsigned int segno);
unsigned int f2fs_usable_blks_in_seg(struct f2fs_sb_info *sbi,
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index a6bb46ccbac2..6d6f7b4e907b 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3110,101 +3110,6 @@ int f2fs_rw_hint_to_seg_type(enum rw_hint hint)
}
}
-/* This returns write hints for each segment type. This hints will be
- * passed down to block layer. There are mapping tables which depend on
- * the mount option 'whint_mode'.
- *
- * 1) whint_mode=off. F2FS only passes down WRITE_LIFE_NOT_SET.
- *
- * 2) whint_mode=user-based. F2FS tries to pass down hints given by users.
- *
- * User F2FS Block
- * ---- ---- -----
- * META WRITE_LIFE_NOT_SET
- * HOT_NODE "
- * WARM_NODE "
- * COLD_NODE "
- * ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
- * extension list " "
- *
- * -- buffered io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
- * WRITE_LIFE_NONE " "
- * WRITE_LIFE_MEDIUM " "
- * WRITE_LIFE_LONG " "
- *
- * -- direct io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
- * WRITE_LIFE_NONE " WRITE_LIFE_NONE
- * WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
- * WRITE_LIFE_LONG " WRITE_LIFE_LONG
- *
- * 3) whint_mode=fs-based. F2FS passes down hints with its policy.
- *
- * User F2FS Block
- * ---- ---- -----
- * META WRITE_LIFE_MEDIUM;
- * HOT_NODE WRITE_LIFE_NOT_SET
- * WARM_NODE "
- * COLD_NODE WRITE_LIFE_NONE
- * ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
- * extension list " "
- *
- * -- buffered io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_LONG
- * WRITE_LIFE_NONE " "
- * WRITE_LIFE_MEDIUM " "
- * WRITE_LIFE_LONG " "
- *
- * -- direct io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
- * WRITE_LIFE_NONE " WRITE_LIFE_NONE
- * WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
- * WRITE_LIFE_LONG " WRITE_LIFE_LONG
- */
-
-enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
- enum page_type type, enum temp_type temp)
-{
- if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_USER) {
- if (type == DATA) {
- if (temp == WARM)
- return WRITE_LIFE_NOT_SET;
- else if (temp == HOT)
- return WRITE_LIFE_SHORT;
- else if (temp == COLD)
- return WRITE_LIFE_EXTREME;
- } else {
- return WRITE_LIFE_NOT_SET;
- }
- } else if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_FS) {
- if (type == DATA) {
- if (temp == WARM)
- return WRITE_LIFE_LONG;
- else if (temp == HOT)
- return WRITE_LIFE_SHORT;
- else if (temp == COLD)
- return WRITE_LIFE_EXTREME;
- } else if (type == NODE) {
- if (temp == WARM || temp == HOT)
- return WRITE_LIFE_NOT_SET;
- else if (temp == COLD)
- return WRITE_LIFE_NONE;
- } else if (type == META) {
- return WRITE_LIFE_MEDIUM;
- }
- }
- return WRITE_LIFE_NOT_SET;
-}
-
static int __get_segment_type_2(struct f2fs_io_info *fio)
{
if (fio->type == DATA)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index fb8fea9f703a..6ab39bf36761 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -214,7 +214,6 @@ static match_table_t f2fs_tokens = {
{Opt_jqfmt_vfsold, "jqfmt=vfsold"},
{Opt_jqfmt_vfsv0, "jqfmt=vfsv0"},
{Opt_jqfmt_vfsv1, "jqfmt=vfsv1"},
- {Opt_whint, "whint_mode=%s"},
{Opt_alloc, "alloc_mode=%s"},
{Opt_fsync, "fsync_mode=%s"},
{Opt_test_dummy_encryption, "test_dummy_encryption=%s"},
@@ -975,22 +974,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
f2fs_info(sbi, "quota operations not supported");
break;
#endif
- case Opt_whint:
- name = match_strdup(&args[0]);
- if (!name)
- return -ENOMEM;
- if (!strcmp(name, "user-based")) {
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_USER;
- } else if (!strcmp(name, "off")) {
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_OFF;
- } else if (!strcmp(name, "fs-based")) {
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_FS;
- } else {
- kfree(name);
- return -EINVAL;
- }
- kfree(name);
- break;
case Opt_alloc:
name = match_strdup(&args[0]);
if (!name)
@@ -1328,12 +1311,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
return -EINVAL;
}
- /* Not pass down write hints if the number of active logs is lesser
- * than NR_CURSEG_PERSIST_TYPE.
- */
- if (F2FS_OPTION(sbi).active_logs != NR_CURSEG_PERSIST_TYPE)
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_OFF;
-
if (f2fs_sb_has_readonly(sbi) && !f2fs_readonly(sbi->sb)) {
f2fs_err(sbi, "Allow to mount readonly mode only");
return -EROFS;
@@ -1974,10 +1951,6 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
seq_puts(seq, ",prjquota");
#endif
f2fs_show_quota_options(seq, sbi->sb);
- if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_USER)
- seq_printf(seq, ",whint_mode=%s", "user-based");
- else if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_FS)
- seq_printf(seq, ",whint_mode=%s", "fs-based");
fscrypt_show_test_dummy_encryption(seq, ',', sbi->sb);
@@ -2029,7 +2002,6 @@ static void default_options(struct f2fs_sb_info *sbi)
F2FS_OPTION(sbi).active_logs = NR_CURSEG_PERSIST_TYPE;
F2FS_OPTION(sbi).inline_xattr_size = DEFAULT_INLINE_XATTR_ADDRS;
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_OFF;
F2FS_OPTION(sbi).alloc_mode = ALLOC_MODE_DEFAULT;
F2FS_OPTION(sbi).fsync_mode = FSYNC_MODE_POSIX;
F2FS_OPTION(sbi).s_resuid = make_kuid(&init_user_ns, F2FS_DEF_RESUID);
@@ -2310,8 +2282,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
need_stop_gc = true;
}
- if (*flags & SB_RDONLY ||
- F2FS_OPTION(sbi).whint_mode != org_mount_opt.whint_mode) {
+ if (*flags & SB_RDONLY) {
sync_inodes_sb(sb);
set_sbi_flag(sbi, SBI_IS_DIRTY);
--
2.36.0.rc0.470.gd361397f0d-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [f2fs-dev] [PATCH 1/2] f2fs: remove obsolete whint_mode
@ 2022-04-13 15:49 ` Jaegeuk Kim
0 siblings, 0 replies; 12+ messages in thread
From: Jaegeuk Kim @ 2022-04-13 15:49 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim
This patch removes obsolete whint_mode.
Fixes: commit 41d36a9f3e53 ("fs: remove kiocb.ki_hint")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
Documentation/filesystems/f2fs.rst | 70 ----------------------
fs/f2fs/f2fs.h | 3 -
fs/f2fs/segment.c | 95 ------------------------------
fs/f2fs/super.c | 31 +---------
4 files changed, 1 insertion(+), 198 deletions(-)
diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
index 4a2426f0485a..ad8dc8c040a2 100644
--- a/Documentation/filesystems/f2fs.rst
+++ b/Documentation/filesystems/f2fs.rst
@@ -235,12 +235,6 @@ offgrpjquota Turn off group journalled quota.
offprjjquota Turn off project journalled quota.
quota Enable plain user disk quota accounting.
noquota Disable all plain disk quota option.
-whint_mode=%s Control which write hints are passed down to block
- layer. This supports "off", "user-based", and
- "fs-based". In "off" mode (default), f2fs does not pass
- down hints. In "user-based" mode, f2fs tries to pass
- down hints given by users. And in "fs-based" mode, f2fs
- passes down hints with its policy.
alloc_mode=%s Adjust block allocation policy, which supports "reuse"
and "default".
fsync_mode=%s Control the policy of fsync. Currently supports "posix",
@@ -751,70 +745,6 @@ In order to identify whether the data in the victim segment are valid or not,
F2FS manages a bitmap. Each bit represents the validity of a block, and the
bitmap is composed of a bit stream covering whole blocks in main area.
-Write-hint Policy
------------------
-
-1) whint_mode=off. F2FS only passes down WRITE_LIFE_NOT_SET.
-
-2) whint_mode=user-based. F2FS tries to pass down hints given by
-users.
-
-===================== ======================== ===================
-User F2FS Block
-===================== ======================== ===================
-N/A META WRITE_LIFE_NOT_SET
-N/A HOT_NODE "
-N/A WARM_NODE "
-N/A COLD_NODE "
-ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
-extension list " "
-
--- buffered io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
-WRITE_LIFE_NONE " "
-WRITE_LIFE_MEDIUM " "
-WRITE_LIFE_LONG " "
-
--- direct io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
-WRITE_LIFE_NONE " WRITE_LIFE_NONE
-WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
-WRITE_LIFE_LONG " WRITE_LIFE_LONG
-===================== ======================== ===================
-
-3) whint_mode=fs-based. F2FS passes down hints with its policy.
-
-===================== ======================== ===================
-User F2FS Block
-===================== ======================== ===================
-N/A META WRITE_LIFE_MEDIUM;
-N/A HOT_NODE WRITE_LIFE_NOT_SET
-N/A WARM_NODE "
-N/A COLD_NODE WRITE_LIFE_NONE
-ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
-extension list " "
-
--- buffered io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_LONG
-WRITE_LIFE_NONE " "
-WRITE_LIFE_MEDIUM " "
-WRITE_LIFE_LONG " "
-
--- direct io
-WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
-WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
-WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
-WRITE_LIFE_NONE " WRITE_LIFE_NONE
-WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
-WRITE_LIFE_LONG " WRITE_LIFE_LONG
-===================== ======================== ===================
-
Fallocate(2) Policy
-------------------
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index f793bbe1e6ce..d76afbb8efdf 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -154,7 +154,6 @@ struct f2fs_mount_info {
int s_jquota_fmt; /* Format of quota to use */
#endif
/* For which write hints are passed down to block layer */
- int whint_mode;
int alloc_mode; /* segment allocation policy */
int fsync_mode; /* fsync policy */
int fs_mode; /* fs mode: LFS or ADAPTIVE */
@@ -3640,8 +3639,6 @@ void f2fs_destroy_segment_manager(struct f2fs_sb_info *sbi);
int __init f2fs_create_segment_manager_caches(void);
void f2fs_destroy_segment_manager_caches(void);
int f2fs_rw_hint_to_seg_type(enum rw_hint hint);
-enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
- enum page_type type, enum temp_type temp);
unsigned int f2fs_usable_segs_in_sec(struct f2fs_sb_info *sbi,
unsigned int segno);
unsigned int f2fs_usable_blks_in_seg(struct f2fs_sb_info *sbi,
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index a6bb46ccbac2..6d6f7b4e907b 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3110,101 +3110,6 @@ int f2fs_rw_hint_to_seg_type(enum rw_hint hint)
}
}
-/* This returns write hints for each segment type. This hints will be
- * passed down to block layer. There are mapping tables which depend on
- * the mount option 'whint_mode'.
- *
- * 1) whint_mode=off. F2FS only passes down WRITE_LIFE_NOT_SET.
- *
- * 2) whint_mode=user-based. F2FS tries to pass down hints given by users.
- *
- * User F2FS Block
- * ---- ---- -----
- * META WRITE_LIFE_NOT_SET
- * HOT_NODE "
- * WARM_NODE "
- * COLD_NODE "
- * ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
- * extension list " "
- *
- * -- buffered io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
- * WRITE_LIFE_NONE " "
- * WRITE_LIFE_MEDIUM " "
- * WRITE_LIFE_LONG " "
- *
- * -- direct io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
- * WRITE_LIFE_NONE " WRITE_LIFE_NONE
- * WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
- * WRITE_LIFE_LONG " WRITE_LIFE_LONG
- *
- * 3) whint_mode=fs-based. F2FS passes down hints with its policy.
- *
- * User F2FS Block
- * ---- ---- -----
- * META WRITE_LIFE_MEDIUM;
- * HOT_NODE WRITE_LIFE_NOT_SET
- * WARM_NODE "
- * COLD_NODE WRITE_LIFE_NONE
- * ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME
- * extension list " "
- *
- * -- buffered io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_LONG
- * WRITE_LIFE_NONE " "
- * WRITE_LIFE_MEDIUM " "
- * WRITE_LIFE_LONG " "
- *
- * -- direct io
- * WRITE_LIFE_EXTREME COLD_DATA WRITE_LIFE_EXTREME
- * WRITE_LIFE_SHORT HOT_DATA WRITE_LIFE_SHORT
- * WRITE_LIFE_NOT_SET WARM_DATA WRITE_LIFE_NOT_SET
- * WRITE_LIFE_NONE " WRITE_LIFE_NONE
- * WRITE_LIFE_MEDIUM " WRITE_LIFE_MEDIUM
- * WRITE_LIFE_LONG " WRITE_LIFE_LONG
- */
-
-enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
- enum page_type type, enum temp_type temp)
-{
- if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_USER) {
- if (type == DATA) {
- if (temp == WARM)
- return WRITE_LIFE_NOT_SET;
- else if (temp == HOT)
- return WRITE_LIFE_SHORT;
- else if (temp == COLD)
- return WRITE_LIFE_EXTREME;
- } else {
- return WRITE_LIFE_NOT_SET;
- }
- } else if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_FS) {
- if (type == DATA) {
- if (temp == WARM)
- return WRITE_LIFE_LONG;
- else if (temp == HOT)
- return WRITE_LIFE_SHORT;
- else if (temp == COLD)
- return WRITE_LIFE_EXTREME;
- } else if (type == NODE) {
- if (temp == WARM || temp == HOT)
- return WRITE_LIFE_NOT_SET;
- else if (temp == COLD)
- return WRITE_LIFE_NONE;
- } else if (type == META) {
- return WRITE_LIFE_MEDIUM;
- }
- }
- return WRITE_LIFE_NOT_SET;
-}
-
static int __get_segment_type_2(struct f2fs_io_info *fio)
{
if (fio->type == DATA)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index fb8fea9f703a..6ab39bf36761 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -214,7 +214,6 @@ static match_table_t f2fs_tokens = {
{Opt_jqfmt_vfsold, "jqfmt=vfsold"},
{Opt_jqfmt_vfsv0, "jqfmt=vfsv0"},
{Opt_jqfmt_vfsv1, "jqfmt=vfsv1"},
- {Opt_whint, "whint_mode=%s"},
{Opt_alloc, "alloc_mode=%s"},
{Opt_fsync, "fsync_mode=%s"},
{Opt_test_dummy_encryption, "test_dummy_encryption=%s"},
@@ -975,22 +974,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
f2fs_info(sbi, "quota operations not supported");
break;
#endif
- case Opt_whint:
- name = match_strdup(&args[0]);
- if (!name)
- return -ENOMEM;
- if (!strcmp(name, "user-based")) {
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_USER;
- } else if (!strcmp(name, "off")) {
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_OFF;
- } else if (!strcmp(name, "fs-based")) {
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_FS;
- } else {
- kfree(name);
- return -EINVAL;
- }
- kfree(name);
- break;
case Opt_alloc:
name = match_strdup(&args[0]);
if (!name)
@@ -1328,12 +1311,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
return -EINVAL;
}
- /* Not pass down write hints if the number of active logs is lesser
- * than NR_CURSEG_PERSIST_TYPE.
- */
- if (F2FS_OPTION(sbi).active_logs != NR_CURSEG_PERSIST_TYPE)
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_OFF;
-
if (f2fs_sb_has_readonly(sbi) && !f2fs_readonly(sbi->sb)) {
f2fs_err(sbi, "Allow to mount readonly mode only");
return -EROFS;
@@ -1974,10 +1951,6 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
seq_puts(seq, ",prjquota");
#endif
f2fs_show_quota_options(seq, sbi->sb);
- if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_USER)
- seq_printf(seq, ",whint_mode=%s", "user-based");
- else if (F2FS_OPTION(sbi).whint_mode == WHINT_MODE_FS)
- seq_printf(seq, ",whint_mode=%s", "fs-based");
fscrypt_show_test_dummy_encryption(seq, ',', sbi->sb);
@@ -2029,7 +2002,6 @@ static void default_options(struct f2fs_sb_info *sbi)
F2FS_OPTION(sbi).active_logs = NR_CURSEG_PERSIST_TYPE;
F2FS_OPTION(sbi).inline_xattr_size = DEFAULT_INLINE_XATTR_ADDRS;
- F2FS_OPTION(sbi).whint_mode = WHINT_MODE_OFF;
F2FS_OPTION(sbi).alloc_mode = ALLOC_MODE_DEFAULT;
F2FS_OPTION(sbi).fsync_mode = FSYNC_MODE_POSIX;
F2FS_OPTION(sbi).s_resuid = make_kuid(&init_user_ns, F2FS_DEF_RESUID);
@@ -2310,8 +2282,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
need_stop_gc = true;
}
- if (*flags & SB_RDONLY ||
- F2FS_OPTION(sbi).whint_mode != org_mount_opt.whint_mode) {
+ if (*flags & SB_RDONLY) {
sync_inodes_sb(sb);
set_sbi_flag(sbi, SBI_IS_DIRTY);
--
2.36.0.rc0.470.gd361397f0d-goog
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
2022-04-13 15:49 ` [f2fs-dev] " Jaegeuk Kim
@ 2022-04-13 15:49 ` Jaegeuk Kim
-1 siblings, 0 replies; 12+ messages in thread
From: Jaegeuk Kim @ 2022-04-13 15:49 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim
Let's attach io_flags to bio only, so that we can merge IOs given original
io_flags only.
Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/data.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index acc523f893ba..fcf0daa386de 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
return 0;
}
-static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
+static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
{
unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
- unsigned int fua_flag = io_flag & temp_mask;
- unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
+ unsigned int fua_flag, meta_flag, io_flag;
+ unsigned int op_flags = 0;
+
+ if (fio->op != REQ_OP_WRITE)
+ return 0;
+ if (fio->type == DATA)
+ io_flag = fio->sbi->data_io_flag;
+ else if (fio->type == NODE)
+ io_flag = fio->sbi->node_io_flag;
+ else
+ return 0;
+
+ fua_flag = io_flag & temp_mask;
+ meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
/*
* data/node io flag bits per temp:
@@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
* Cold | Warm | Hot | Cold | Warm | Hot |
*/
if ((1 << fio->temp) & meta_flag)
- fio->op_flags |= REQ_META;
+ op_flags |= REQ_META;
if ((1 << fio->temp) & fua_flag)
- fio->op_flags |= REQ_FUA;
+ op_flags |= REQ_FUA;
+ return op_flags;
}
static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
@@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
sector_t sector;
struct bio *bio;
- if (fio->type == DATA)
- __attach_io_flag(fio, sbi->data_io_flag);
- else if (fio->type == NODE)
- __attach_io_flag(fio, sbi->node_io_flag);
-
bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
- bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
- &f2fs_bioset);
+ bio = bio_alloc_bioset(bdev, npages,
+ fio->op | fio->op_flags | f2fs_io_flags(fio),
+ GFP_NOIO, &f2fs_bioset);
bio->bi_iter.bi_sector = sector;
if (is_read_io(fio->op)) {
bio->bi_end_io = f2fs_read_end_io;
--
2.36.0.rc0.470.gd361397f0d-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [f2fs-dev] [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
@ 2022-04-13 15:49 ` Jaegeuk Kim
0 siblings, 0 replies; 12+ messages in thread
From: Jaegeuk Kim @ 2022-04-13 15:49 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim
Let's attach io_flags to bio only, so that we can merge IOs given original
io_flags only.
Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/data.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index acc523f893ba..fcf0daa386de 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
return 0;
}
-static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
+static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
{
unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
- unsigned int fua_flag = io_flag & temp_mask;
- unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
+ unsigned int fua_flag, meta_flag, io_flag;
+ unsigned int op_flags = 0;
+
+ if (fio->op != REQ_OP_WRITE)
+ return 0;
+ if (fio->type == DATA)
+ io_flag = fio->sbi->data_io_flag;
+ else if (fio->type == NODE)
+ io_flag = fio->sbi->node_io_flag;
+ else
+ return 0;
+
+ fua_flag = io_flag & temp_mask;
+ meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
/*
* data/node io flag bits per temp:
@@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
* Cold | Warm | Hot | Cold | Warm | Hot |
*/
if ((1 << fio->temp) & meta_flag)
- fio->op_flags |= REQ_META;
+ op_flags |= REQ_META;
if ((1 << fio->temp) & fua_flag)
- fio->op_flags |= REQ_FUA;
+ op_flags |= REQ_FUA;
+ return op_flags;
}
static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
@@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
sector_t sector;
struct bio *bio;
- if (fio->type == DATA)
- __attach_io_flag(fio, sbi->data_io_flag);
- else if (fio->type == NODE)
- __attach_io_flag(fio, sbi->node_io_flag);
-
bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
- bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
- &f2fs_bioset);
+ bio = bio_alloc_bioset(bdev, npages,
+ fio->op | fio->op_flags | f2fs_io_flags(fio),
+ GFP_NOIO, &f2fs_bioset);
bio->bi_iter.bi_sector = sector;
if (is_read_io(fio->op)) {
bio->bi_end_io = f2fs_read_end_io;
--
2.36.0.rc0.470.gd361397f0d-goog
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
2022-04-13 15:49 ` [f2fs-dev] " Jaegeuk Kim
@ 2022-04-17 6:55 ` Chao Yu
-1 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-04-17 6:55 UTC (permalink / raw)
To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel
On 2022/4/13 23:49, Jaegeuk Kim wrote:
> Let's attach io_flags to bio only, so that we can merge IOs given original
> io_flags only.
>
> Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
Nice catch.
Wasn't this bug introduced by:
commit da9953b729c1 ("f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA")
static void __attach_data_io_flag(struct f2fs_io_info *fio)
{
...
if ((1 << fio->temp) & meta_flag)
fio->op_flags |= REQ_META;
if ((1 << fio->temp) & fua_flag)
fio->op_flags |= REQ_FUA;
...
Thanks,
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/data.c | 33 +++++++++++++++++++++------------
> 1 file changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index acc523f893ba..fcf0daa386de 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
> return 0;
> }
>
> -static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> +static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
> {
> unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
> - unsigned int fua_flag = io_flag & temp_mask;
> - unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
> + unsigned int fua_flag, meta_flag, io_flag;
> + unsigned int op_flags = 0;
> +
> + if (fio->op != REQ_OP_WRITE)
> + return 0;
> + if (fio->type == DATA)
> + io_flag = fio->sbi->data_io_flag;
> + else if (fio->type == NODE)
> + io_flag = fio->sbi->node_io_flag;
> + else
> + return 0;
> +
> + fua_flag = io_flag & temp_mask;
> + meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
>
> /*
> * data/node io flag bits per temp:
> @@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> * Cold | Warm | Hot | Cold | Warm | Hot |
> */
> if ((1 << fio->temp) & meta_flag)
> - fio->op_flags |= REQ_META;
> + op_flags |= REQ_META;
> if ((1 << fio->temp) & fua_flag)
> - fio->op_flags |= REQ_FUA;
> + op_flags |= REQ_FUA;
> + return op_flags;
> }
>
> static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> @@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> sector_t sector;
> struct bio *bio;
>
> - if (fio->type == DATA)
> - __attach_io_flag(fio, sbi->data_io_flag);
> - else if (fio->type == NODE)
> - __attach_io_flag(fio, sbi->node_io_flag);
> -
> bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
> - bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
> - &f2fs_bioset);
> + bio = bio_alloc_bioset(bdev, npages,
> + fio->op | fio->op_flags | f2fs_io_flags(fio),
> + GFP_NOIO, &f2fs_bioset);
> bio->bi_iter.bi_sector = sector;
> if (is_read_io(fio->op)) {
> bio->bi_end_io = f2fs_read_end_io;
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
@ 2022-04-17 6:55 ` Chao Yu
0 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-04-17 6:55 UTC (permalink / raw)
To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel
On 2022/4/13 23:49, Jaegeuk Kim wrote:
> Let's attach io_flags to bio only, so that we can merge IOs given original
> io_flags only.
>
> Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
Nice catch.
Wasn't this bug introduced by:
commit da9953b729c1 ("f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA")
static void __attach_data_io_flag(struct f2fs_io_info *fio)
{
...
if ((1 << fio->temp) & meta_flag)
fio->op_flags |= REQ_META;
if ((1 << fio->temp) & fua_flag)
fio->op_flags |= REQ_FUA;
...
Thanks,
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/data.c | 33 +++++++++++++++++++++------------
> 1 file changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index acc523f893ba..fcf0daa386de 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
> return 0;
> }
>
> -static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> +static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
> {
> unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
> - unsigned int fua_flag = io_flag & temp_mask;
> - unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
> + unsigned int fua_flag, meta_flag, io_flag;
> + unsigned int op_flags = 0;
> +
> + if (fio->op != REQ_OP_WRITE)
> + return 0;
> + if (fio->type == DATA)
> + io_flag = fio->sbi->data_io_flag;
> + else if (fio->type == NODE)
> + io_flag = fio->sbi->node_io_flag;
> + else
> + return 0;
> +
> + fua_flag = io_flag & temp_mask;
> + meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
>
> /*
> * data/node io flag bits per temp:
> @@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> * Cold | Warm | Hot | Cold | Warm | Hot |
> */
> if ((1 << fio->temp) & meta_flag)
> - fio->op_flags |= REQ_META;
> + op_flags |= REQ_META;
> if ((1 << fio->temp) & fua_flag)
> - fio->op_flags |= REQ_FUA;
> + op_flags |= REQ_FUA;
> + return op_flags;
> }
>
> static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> @@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> sector_t sector;
> struct bio *bio;
>
> - if (fio->type == DATA)
> - __attach_io_flag(fio, sbi->data_io_flag);
> - else if (fio->type == NODE)
> - __attach_io_flag(fio, sbi->node_io_flag);
> -
> bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
> - bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
> - &f2fs_bioset);
> + bio = bio_alloc_bioset(bdev, npages,
> + fio->op | fio->op_flags | f2fs_io_flags(fio),
> + GFP_NOIO, &f2fs_bioset);
> bio->bi_iter.bi_sector = sector;
> if (is_read_io(fio->op)) {
> bio->bi_end_io = f2fs_read_end_io;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
2022-04-17 6:55 ` Chao Yu
@ 2022-04-19 22:47 ` Jaegeuk Kim
-1 siblings, 0 replies; 12+ messages in thread
From: Jaegeuk Kim @ 2022-04-19 22:47 UTC (permalink / raw)
To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel
On 04/17, Chao Yu wrote:
> On 2022/4/13 23:49, Jaegeuk Kim wrote:
> > Let's attach io_flags to bio only, so that we can merge IOs given original
> > io_flags only.
> >
> > Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
>
> Nice catch.
>
> Wasn't this bug introduced by:
I don't think so.
>
> commit da9953b729c1 ("f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA")
>
> static void __attach_data_io_flag(struct f2fs_io_info *fio)
> {
> ...
> if ((1 << fio->temp) & meta_flag)
> fio->op_flags |= REQ_META;
> if ((1 << fio->temp) & fua_flag)
> fio->op_flags |= REQ_FUA;
> ...
>
> Thanks,
>
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> > fs/f2fs/data.c | 33 +++++++++++++++++++++------------
> > 1 file changed, 21 insertions(+), 12 deletions(-)
> >
> > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> > index acc523f893ba..fcf0daa386de 100644
> > --- a/fs/f2fs/data.c
> > +++ b/fs/f2fs/data.c
> > @@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
> > return 0;
> > }
> > -static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> > +static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
> > {
> > unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
> > - unsigned int fua_flag = io_flag & temp_mask;
> > - unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
> > + unsigned int fua_flag, meta_flag, io_flag;
> > + unsigned int op_flags = 0;
> > +
> > + if (fio->op != REQ_OP_WRITE)
> > + return 0;
> > + if (fio->type == DATA)
> > + io_flag = fio->sbi->data_io_flag;
> > + else if (fio->type == NODE)
> > + io_flag = fio->sbi->node_io_flag;
> > + else
> > + return 0;
> > +
> > + fua_flag = io_flag & temp_mask;
> > + meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
> > /*
> > * data/node io flag bits per temp:
> > @@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> > * Cold | Warm | Hot | Cold | Warm | Hot |
> > */
> > if ((1 << fio->temp) & meta_flag)
> > - fio->op_flags |= REQ_META;
> > + op_flags |= REQ_META;
> > if ((1 << fio->temp) & fua_flag)
> > - fio->op_flags |= REQ_FUA;
> > + op_flags |= REQ_FUA;
> > + return op_flags;
> > }
> > static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> > @@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> > sector_t sector;
> > struct bio *bio;
> > - if (fio->type == DATA)
> > - __attach_io_flag(fio, sbi->data_io_flag);
> > - else if (fio->type == NODE)
> > - __attach_io_flag(fio, sbi->node_io_flag);
> > -
> > bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
> > - bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
> > - &f2fs_bioset);
> > + bio = bio_alloc_bioset(bdev, npages,
> > + fio->op | fio->op_flags | f2fs_io_flags(fio),
> > + GFP_NOIO, &f2fs_bioset);
> > bio->bi_iter.bi_sector = sector;
> > if (is_read_io(fio->op)) {
> > bio->bi_end_io = f2fs_read_end_io;
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
@ 2022-04-19 22:47 ` Jaegeuk Kim
0 siblings, 0 replies; 12+ messages in thread
From: Jaegeuk Kim @ 2022-04-19 22:47 UTC (permalink / raw)
To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel
On 04/17, Chao Yu wrote:
> On 2022/4/13 23:49, Jaegeuk Kim wrote:
> > Let's attach io_flags to bio only, so that we can merge IOs given original
> > io_flags only.
> >
> > Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
>
> Nice catch.
>
> Wasn't this bug introduced by:
I don't think so.
>
> commit da9953b729c1 ("f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA")
>
> static void __attach_data_io_flag(struct f2fs_io_info *fio)
> {
> ...
> if ((1 << fio->temp) & meta_flag)
> fio->op_flags |= REQ_META;
> if ((1 << fio->temp) & fua_flag)
> fio->op_flags |= REQ_FUA;
> ...
>
> Thanks,
>
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> > fs/f2fs/data.c | 33 +++++++++++++++++++++------------
> > 1 file changed, 21 insertions(+), 12 deletions(-)
> >
> > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> > index acc523f893ba..fcf0daa386de 100644
> > --- a/fs/f2fs/data.c
> > +++ b/fs/f2fs/data.c
> > @@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
> > return 0;
> > }
> > -static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> > +static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
> > {
> > unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
> > - unsigned int fua_flag = io_flag & temp_mask;
> > - unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
> > + unsigned int fua_flag, meta_flag, io_flag;
> > + unsigned int op_flags = 0;
> > +
> > + if (fio->op != REQ_OP_WRITE)
> > + return 0;
> > + if (fio->type == DATA)
> > + io_flag = fio->sbi->data_io_flag;
> > + else if (fio->type == NODE)
> > + io_flag = fio->sbi->node_io_flag;
> > + else
> > + return 0;
> > +
> > + fua_flag = io_flag & temp_mask;
> > + meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
> > /*
> > * data/node io flag bits per temp:
> > @@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
> > * Cold | Warm | Hot | Cold | Warm | Hot |
> > */
> > if ((1 << fio->temp) & meta_flag)
> > - fio->op_flags |= REQ_META;
> > + op_flags |= REQ_META;
> > if ((1 << fio->temp) & fua_flag)
> > - fio->op_flags |= REQ_FUA;
> > + op_flags |= REQ_FUA;
> > + return op_flags;
> > }
> > static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> > @@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
> > sector_t sector;
> > struct bio *bio;
> > - if (fio->type == DATA)
> > - __attach_io_flag(fio, sbi->data_io_flag);
> > - else if (fio->type == NODE)
> > - __attach_io_flag(fio, sbi->node_io_flag);
> > -
> > bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
> > - bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
> > - &f2fs_bioset);
> > + bio = bio_alloc_bioset(bdev, npages,
> > + fio->op | fio->op_flags | f2fs_io_flags(fio),
> > + GFP_NOIO, &f2fs_bioset);
> > bio->bi_iter.bi_sector = sector;
> > if (is_read_io(fio->op)) {
> > bio->bi_end_io = f2fs_read_end_io;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
2022-04-19 22:47 ` Jaegeuk Kim
@ 2022-04-20 2:45 ` Chao Yu
-1 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-04-20 2:45 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel
On 2022/4/20 6:47, Jaegeuk Kim wrote:
> On 04/17, Chao Yu wrote:
>> On 2022/4/13 23:49, Jaegeuk Kim wrote:
>>> Let's attach io_flags to bio only, so that we can merge IOs given original
>>> io_flags only.
>>>
>>> Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
>>
>> Nice catch.
>>
>> Wasn't this bug introduced by:
>
> I don't think so.
Oh, correct, it looks in original patch, we only attach IO flag before
__submit_bio().
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
>
>>
>> commit da9953b729c1 ("f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA")
>>
>> static void __attach_data_io_flag(struct f2fs_io_info *fio)
>> {
>> ...
>> if ((1 << fio->temp) & meta_flag)
>> fio->op_flags |= REQ_META;
>> if ((1 << fio->temp) & fua_flag)
>> fio->op_flags |= REQ_FUA;
>> ...
>>
>> Thanks,
>>
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>>> ---
>>> fs/f2fs/data.c | 33 +++++++++++++++++++++------------
>>> 1 file changed, 21 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>>> index acc523f893ba..fcf0daa386de 100644
>>> --- a/fs/f2fs/data.c
>>> +++ b/fs/f2fs/data.c
>>> @@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
>>> return 0;
>>> }
>>> -static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
>>> +static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
>>> {
>>> unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
>>> - unsigned int fua_flag = io_flag & temp_mask;
>>> - unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
>>> + unsigned int fua_flag, meta_flag, io_flag;
>>> + unsigned int op_flags = 0;
>>> +
>>> + if (fio->op != REQ_OP_WRITE)
>>> + return 0;
>>> + if (fio->type == DATA)
>>> + io_flag = fio->sbi->data_io_flag;
>>> + else if (fio->type == NODE)
>>> + io_flag = fio->sbi->node_io_flag;
>>> + else
>>> + return 0;
>>> +
>>> + fua_flag = io_flag & temp_mask;
>>> + meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
>>> /*
>>> * data/node io flag bits per temp:
>>> @@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
>>> * Cold | Warm | Hot | Cold | Warm | Hot |
>>> */
>>> if ((1 << fio->temp) & meta_flag)
>>> - fio->op_flags |= REQ_META;
>>> + op_flags |= REQ_META;
>>> if ((1 << fio->temp) & fua_flag)
>>> - fio->op_flags |= REQ_FUA;
>>> + op_flags |= REQ_FUA;
>>> + return op_flags;
>>> }
>>> static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
>>> @@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
>>> sector_t sector;
>>> struct bio *bio;
>>> - if (fio->type == DATA)
>>> - __attach_io_flag(fio, sbi->data_io_flag);
>>> - else if (fio->type == NODE)
>>> - __attach_io_flag(fio, sbi->node_io_flag);
>>> -
>>> bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
>>> - bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
>>> - &f2fs_bioset);
>>> + bio = bio_alloc_bioset(bdev, npages,
>>> + fio->op | fio->op_flags | f2fs_io_flags(fio),
>>> + GFP_NOIO, &f2fs_bioset);
>>> bio->bi_iter.bi_sector = sector;
>>> if (is_read_io(fio->op)) {
>>> bio->bi_end_io = f2fs_read_end_io;
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
@ 2022-04-20 2:45 ` Chao Yu
0 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-04-20 2:45 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel
On 2022/4/20 6:47, Jaegeuk Kim wrote:
> On 04/17, Chao Yu wrote:
>> On 2022/4/13 23:49, Jaegeuk Kim wrote:
>>> Let's attach io_flags to bio only, so that we can merge IOs given original
>>> io_flags only.
>>>
>>> Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset")
>>
>> Nice catch.
>>
>> Wasn't this bug introduced by:
>
> I don't think so.
Oh, correct, it looks in original patch, we only attach IO flag before
__submit_bio().
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
>
>>
>> commit da9953b729c1 ("f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA")
>>
>> static void __attach_data_io_flag(struct f2fs_io_info *fio)
>> {
>> ...
>> if ((1 << fio->temp) & meta_flag)
>> fio->op_flags |= REQ_META;
>> if ((1 << fio->temp) & fua_flag)
>> fio->op_flags |= REQ_FUA;
>> ...
>>
>> Thanks,
>>
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>>> ---
>>> fs/f2fs/data.c | 33 +++++++++++++++++++++------------
>>> 1 file changed, 21 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>>> index acc523f893ba..fcf0daa386de 100644
>>> --- a/fs/f2fs/data.c
>>> +++ b/fs/f2fs/data.c
>>> @@ -387,11 +387,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
>>> return 0;
>>> }
>>> -static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
>>> +static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
>>> {
>>> unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
>>> - unsigned int fua_flag = io_flag & temp_mask;
>>> - unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
>>> + unsigned int fua_flag, meta_flag, io_flag;
>>> + unsigned int op_flags = 0;
>>> +
>>> + if (fio->op != REQ_OP_WRITE)
>>> + return 0;
>>> + if (fio->type == DATA)
>>> + io_flag = fio->sbi->data_io_flag;
>>> + else if (fio->type == NODE)
>>> + io_flag = fio->sbi->node_io_flag;
>>> + else
>>> + return 0;
>>> +
>>> + fua_flag = io_flag & temp_mask;
>>> + meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
>>> /*
>>> * data/node io flag bits per temp:
>>> @@ -400,9 +412,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
>>> * Cold | Warm | Hot | Cold | Warm | Hot |
>>> */
>>> if ((1 << fio->temp) & meta_flag)
>>> - fio->op_flags |= REQ_META;
>>> + op_flags |= REQ_META;
>>> if ((1 << fio->temp) & fua_flag)
>>> - fio->op_flags |= REQ_FUA;
>>> + op_flags |= REQ_FUA;
>>> + return op_flags;
>>> }
>>> static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
>>> @@ -412,14 +425,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
>>> sector_t sector;
>>> struct bio *bio;
>>> - if (fio->type == DATA)
>>> - __attach_io_flag(fio, sbi->data_io_flag);
>>> - else if (fio->type == NODE)
>>> - __attach_io_flag(fio, sbi->node_io_flag);
>>> -
>>> bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
>>> - bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
>>> - &f2fs_bioset);
>>> + bio = bio_alloc_bioset(bdev, npages,
>>> + fio->op | fio->op_flags | f2fs_io_flags(fio),
>>> + GFP_NOIO, &f2fs_bioset);
>>> bio->bi_iter.bi_sector = sector;
>>> if (is_read_io(fio->op)) {
>>> bio->bi_end_io = f2fs_read_end_io;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [f2fs-dev] [PATCH 1/2] f2fs: remove obsolete whint_mode
2022-04-13 15:49 ` [f2fs-dev] " Jaegeuk Kim
@ 2022-04-17 6:32 ` Chao Yu
-1 siblings, 0 replies; 12+ messages in thread
From: Chao Yu @ 2022-04-17 6:32 UTC (permalink / raw)
To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel
On 2022/4/13 23:49, Jaegeuk Kim wrote:
> This patch removes obsolete whint_mode.
>
> Fixes: commit 41d36a9f3e53 ("fs: remove kiocb.ki_hint")
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2022-04-20 2:45 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 15:49 [PATCH 1/2] f2fs: remove obsolete whint_mode Jaegeuk Kim
2022-04-13 15:49 ` [f2fs-dev] " Jaegeuk Kim
2022-04-13 15:49 ` [PATCH 2/2] f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders Jaegeuk Kim
2022-04-13 15:49 ` [f2fs-dev] " Jaegeuk Kim
2022-04-17 6:55 ` Chao Yu
2022-04-17 6:55 ` Chao Yu
2022-04-19 22:47 ` Jaegeuk Kim
2022-04-19 22:47 ` Jaegeuk Kim
2022-04-20 2:45 ` Chao Yu
2022-04-20 2:45 ` Chao Yu
2022-04-17 6:32 ` [f2fs-dev] [PATCH 1/2] f2fs: remove obsolete whint_mode Chao Yu
2022-04-17 6:32 ` Chao Yu
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.