linux-f2fs-devel Mailing List for linux-f2fs
Brought to you by:
kjgkr
You can subscribe to this list here.
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(98) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2013 |
Jan
(100) |
Feb
(72) |
Mar
(79) |
Apr
(122) |
May
(93) |
Jun
(97) |
Jul
(72) |
Aug
(72) |
Sep
(73) |
Oct
(121) |
Nov
(161) |
Dec
(206) |
2014 |
Jan
(75) |
Feb
(54) |
Mar
(82) |
Apr
(98) |
May
(67) |
Jun
(89) |
Jul
(136) |
Aug
(122) |
Sep
(136) |
Oct
(58) |
Nov
(87) |
Dec
(114) |
2015 |
Jan
(140) |
Feb
(129) |
Mar
(141) |
Apr
(71) |
May
(192) |
Jun
(52) |
Jul
(120) |
Aug
(125) |
Sep
(157) |
Oct
(100) |
Nov
(54) |
Dec
(248) |
2016 |
Jan
(301) |
Feb
(180) |
Mar
(138) |
Apr
(137) |
May
(145) |
Jun
(123) |
Jul
(98) |
Aug
(143) |
Sep
(196) |
Oct
(166) |
Nov
(205) |
Dec
(141) |
2017 |
Jan
(167) |
Feb
(275) |
Mar
(273) |
Apr
(239) |
May
(193) |
Jun
(171) |
Jul
(226) |
Aug
(153) |
Sep
(212) |
Oct
(311) |
Nov
(257) |
Dec
(418) |
2018 |
Jan
(474) |
Feb
(188) |
Mar
(252) |
Apr
(500) |
May
(176) |
Jun
(291) |
Jul
(361) |
Aug
(331) |
Sep
(355) |
Oct
(154) |
Nov
(209) |
Dec
(185) |
2019 |
Jan
(172) |
Feb
(214) |
Mar
(247) |
Apr
(425) |
May
(273) |
Jun
(360) |
Jul
(400) |
Aug
(409) |
Sep
(149) |
Oct
(218) |
Nov
(319) |
Dec
(225) |
2020 |
Jan
(231) |
Feb
(487) |
Mar
(411) |
Apr
(258) |
May
(292) |
Jun
(369) |
Jul
(407) |
Aug
(173) |
Sep
(266) |
Oct
(317) |
Nov
(273) |
Dec
(391) |
2021 |
Jan
(285) |
Feb
(130) |
Mar
(232) |
Apr
(156) |
May
(311) |
Jun
(252) |
Jul
(336) |
Aug
(326) |
Sep
(151) |
Oct
(86) |
Nov
(114) |
Dec
(125) |
2022 |
Jan
(132) |
Feb
(167) |
Mar
(230) |
Apr
(460) |
May
(334) |
Jun
(324) |
Jul
(147) |
Aug
(188) |
Sep
(262) |
Oct
(346) |
Nov
(314) |
Dec
(245) |
2023 |
Jan
(306) |
Feb
(190) |
Mar
(199) |
Apr
(444) |
May
(378) |
Jun
(441) |
Jul
(403) |
Aug
(464) |
Sep
(144) |
Oct
(98) |
Nov
(152) |
Dec
(212) |
2024 |
Jan
(288) |
Feb
(365) |
Mar
(218) |
Apr
(275) |
May
(200) |
Jun
(228) |
Jul
(255) |
Aug
(228) |
Sep
(280) |
Oct
(319) |
Nov
(241) |
Dec
(174) |
2025 |
Jan
(166) |
Feb
(171) |
Mar
(469) |
Apr
(235) |
May
(257) |
Jun
(342) |
Jul
(331) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: wangzijie <wan...@ho...> - 2025-07-28 05:02:52
|
When we need to alloc nat entry and set it dirty, we can directly add it to dirty set list(or initialize its list_head for new_ne) instead of adding it to clean list and make a move. Introduce init_dirty flag to do it. Signed-off-by: wangzijie <wan...@ho...> --- v3: - followed by Chao's suggestion to clean up code --- fs/f2fs/node.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 940b52d38..27743b93e 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -185,7 +185,7 @@ static void __free_nat_entry(struct nat_entry *e) /* must be locked by nat_tree_lock */ static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, - struct nat_entry *ne, struct f2fs_nat_entry *raw_ne, bool no_fail) + struct nat_entry *ne, struct f2fs_nat_entry *raw_ne, bool no_fail, bool init_dirty) { if (no_fail) f2fs_radix_tree_insert(&nm_i->nat_root, nat_get_nid(ne), ne); @@ -195,6 +195,12 @@ static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, if (raw_ne) node_info_from_raw_nat(&ne->ni, raw_ne); + if (init_dirty) { + INIT_LIST_HEAD(&ne->list); + nm_i->nat_cnt[TOTAL_NAT]++; + return ne; + } + spin_lock(&nm_i->nat_list_lock); list_add_tail(&ne->list, &nm_i->nat_entries); spin_unlock(&nm_i->nat_list_lock); @@ -259,7 +265,7 @@ static struct nat_entry_set *__grab_nat_entry_set(struct f2fs_nm_info *nm_i, } static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, - struct nat_entry *ne) + struct nat_entry *ne, bool init_dirty) { struct nat_entry_set *head; bool new_ne = nat_get_blkaddr(ne) == NEW_ADDR; @@ -282,7 +288,8 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, goto refresh_list; nm_i->nat_cnt[DIRTY_NAT]++; - nm_i->nat_cnt[RECLAIMABLE_NAT]--; + if (!init_dirty) + nm_i->nat_cnt[RECLAIMABLE_NAT]--; set_nat_flag(ne, IS_DIRTY, true); refresh_list: spin_lock(&nm_i->nat_list_lock); @@ -444,7 +451,7 @@ static void cache_nat_entry(struct f2fs_sb_info *sbi, nid_t nid, f2fs_down_write(&nm_i->nat_tree_lock); e = __lookup_nat_cache(nm_i, nid, false); if (!e) - e = __init_nat_entry(nm_i, new, ne, false); + e = __init_nat_entry(nm_i, new, ne, false, false); else f2fs_bug_on(sbi, nat_get_ino(e) != le32_to_cpu(ne->ino) || nat_get_blkaddr(e) != @@ -461,11 +468,13 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, struct f2fs_nm_info *nm_i = NM_I(sbi); struct nat_entry *e; struct nat_entry *new = __alloc_nat_entry(sbi, ni->nid, true); + bool init_dirty = false; f2fs_down_write(&nm_i->nat_tree_lock); e = __lookup_nat_cache(nm_i, ni->nid, true); if (!e) { - e = __init_nat_entry(nm_i, new, NULL, true); + init_dirty = true; + e = __init_nat_entry(nm_i, new, NULL, true, true); copy_node_info(&e->ni, ni); f2fs_bug_on(sbi, ni->blk_addr == NEW_ADDR); } else if (new_blkaddr == NEW_ADDR) { @@ -501,7 +510,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, nat_set_blkaddr(e, new_blkaddr); if (!__is_valid_data_blkaddr(new_blkaddr)) set_nat_flag(e, IS_CHECKPOINTED, false); - __set_nat_cache_dirty(nm_i, e); + __set_nat_cache_dirty(nm_i, e, init_dirty); /* update fsync_mark if its inode nat entry is still alive */ if (ni->nid != ni->ino) @@ -2927,6 +2936,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_HOT_DATA); struct f2fs_journal *journal = curseg->journal; int i; + bool init_dirty; down_write(&curseg->journal_rwsem); for (i = 0; i < nats_in_cursum(journal); i++) { @@ -2937,12 +2947,15 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) if (f2fs_check_nid_range(sbi, nid)) continue; + init_dirty = false; + raw_ne = nat_in_journal(journal, i); ne = __lookup_nat_cache(nm_i, nid, true); if (!ne) { + init_dirty = true; ne = __alloc_nat_entry(sbi, nid, true); - __init_nat_entry(nm_i, ne, &raw_ne, true); + __init_nat_entry(nm_i, ne, &raw_ne, true, true); } /* @@ -2957,7 +2970,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) spin_unlock(&nm_i->nid_list_lock); } - __set_nat_cache_dirty(nm_i, ne); + __set_nat_cache_dirty(nm_i, ne, init_dirty); } update_nats_in_cursum(journal, -i); up_write(&curseg->journal_rwsem); -- 2.25.1 |
From: wangzijie <wan...@ho...> - 2025-07-28 05:02:51
|
__lookup_nat_cache follows LRU manner to move clean nat entry, when nat entries are going to be dirty, no need to move them to tail of lru list. Introduce a parameter 'for_dirty' to avoid it. Signed-off-by: wangzijie <wan...@ho...> --- v3: - followed by Chao's suggestion to update comments v2: - followed by Jaegeuk's suggestion to add a parameter in __lookup_nat_cache --- fs/f2fs/node.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 76aba1961..940b52d38 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -204,14 +204,17 @@ static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, return ne; } -static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n) +static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n, bool for_dirty) { struct nat_entry *ne; ne = radix_tree_lookup(&nm_i->nat_root, n); - /* for recent accessed nat entry, move it to tail of lru list */ - if (ne && !get_nat_flag(ne, IS_DIRTY)) { + /* + * for recent accessed nat entry which will not be dirtied soon + * later, move it to tail of lru list. + */ + if (ne && !get_nat_flag(ne, IS_DIRTY) && !for_dirty) { spin_lock(&nm_i->nat_list_lock); if (!list_empty(&ne->list)) list_move_tail(&ne->list, &nm_i->nat_entries); @@ -383,7 +386,7 @@ int f2fs_need_dentry_mark(struct f2fs_sb_info *sbi, nid_t nid) bool need = false; f2fs_down_read(&nm_i->nat_tree_lock); - e = __lookup_nat_cache(nm_i, nid); + e = __lookup_nat_cache(nm_i, nid, false); if (e) { if (!get_nat_flag(e, IS_CHECKPOINTED) && !get_nat_flag(e, HAS_FSYNCED_INODE)) @@ -400,7 +403,7 @@ bool f2fs_is_checkpointed_node(struct f2fs_sb_info *sbi, nid_t nid) bool is_cp = true; f2fs_down_read(&nm_i->nat_tree_lock); - e = __lookup_nat_cache(nm_i, nid); + e = __lookup_nat_cache(nm_i, nid, false); if (e && !get_nat_flag(e, IS_CHECKPOINTED)) is_cp = false; f2fs_up_read(&nm_i->nat_tree_lock); @@ -414,7 +417,7 @@ bool f2fs_need_inode_block_update(struct f2fs_sb_info *sbi, nid_t ino) bool need_update = true; f2fs_down_read(&nm_i->nat_tree_lock); - e = __lookup_nat_cache(nm_i, ino); + e = __lookup_nat_cache(nm_i, ino, false); if (e && get_nat_flag(e, HAS_LAST_FSYNC) && (get_nat_flag(e, IS_CHECKPOINTED) || get_nat_flag(e, HAS_FSYNCED_INODE))) @@ -439,7 +442,7 @@ static void cache_nat_entry(struct f2fs_sb_info *sbi, nid_t nid, return; f2fs_down_write(&nm_i->nat_tree_lock); - e = __lookup_nat_cache(nm_i, nid); + e = __lookup_nat_cache(nm_i, nid, false); if (!e) e = __init_nat_entry(nm_i, new, ne, false); else @@ -460,7 +463,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, struct nat_entry *new = __alloc_nat_entry(sbi, ni->nid, true); f2fs_down_write(&nm_i->nat_tree_lock); - e = __lookup_nat_cache(nm_i, ni->nid); + e = __lookup_nat_cache(nm_i, ni->nid, true); if (!e) { e = __init_nat_entry(nm_i, new, NULL, true); copy_node_info(&e->ni, ni); @@ -502,7 +505,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, /* update fsync_mark if its inode nat entry is still alive */ if (ni->nid != ni->ino) - e = __lookup_nat_cache(nm_i, ni->ino); + e = __lookup_nat_cache(nm_i, ni->ino, false); if (e) { if (fsync_done && ni->nid == ni->ino) set_nat_flag(e, HAS_FSYNCED_INODE, true); @@ -562,7 +565,7 @@ int f2fs_get_node_info(struct f2fs_sb_info *sbi, nid_t nid, retry: /* Check nat cache */ f2fs_down_read(&nm_i->nat_tree_lock); - e = __lookup_nat_cache(nm_i, nid); + e = __lookup_nat_cache(nm_i, nid, false); if (e) { ni->ino = nat_get_ino(e); ni->blk_addr = nat_get_blkaddr(e); @@ -2371,7 +2374,7 @@ static bool add_free_nid(struct f2fs_sb_info *sbi, * - __remove_nid_from_list(PREALLOC_NID) * - __insert_nid_to_list(FREE_NID) */ - ne = __lookup_nat_cache(nm_i, nid); + ne = __lookup_nat_cache(nm_i, nid, false); if (ne && (!get_nat_flag(ne, IS_CHECKPOINTED) || nat_get_blkaddr(ne) != NULL_ADDR)) goto err_out; @@ -2936,7 +2939,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) raw_ne = nat_in_journal(journal, i); - ne = __lookup_nat_cache(nm_i, nid); + ne = __lookup_nat_cache(nm_i, nid, true); if (!ne) { ne = __alloc_nat_entry(sbi, nid, true); __init_nat_entry(nm_i, ne, &raw_ne, true); -- 2.25.1 |
From: Chao Yu <ch...@ke...> - 2025-07-28 02:05:50
|
It provides a way to disable linear lookup fallback during mkfs. Behavior summary: Android Distro By default disabled enabled Android case: 1.1) Disable linear lookup: - mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 1.2) Enable linear lookup: - mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] 1.3) By default: - mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb Info: set default linear_lookup option: disable - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] Distro case: 2.1) Disable linear lookup: - mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 2.2) Enable linear lookup: - mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] 2.3) By default: - mkfs.f2fs -f -O casefold -C utf8 /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] Reviewed-by: Zhiguo Niu <zhi...@un...> Signed-off-by: Chao Yu <ch...@ke...> --- v4: - fix typo in manual page include/f2fs_fs.h | 3 ++- lib/libf2fs.c | 6 ++++++ man/mkfs.f2fs.8 | 9 ++++++++- mkfs/f2fs_format.c | 11 +++++++++++ mkfs/f2fs_format_main.c | 3 ++- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index f7268d1..a8da8fa 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -1478,7 +1478,8 @@ enum { /* feature list in Android */ enum { - F2FS_FEATURE_NAT_BITS = 0x0001, + F2FS_FEATURE_NAT_BITS = 0x0001, + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, }; /* nolinear lookup tune */ diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 2f012c8..1a496b7 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -1424,6 +1424,7 @@ static const struct enc_flags { char *param; } encoding_flags[] = { { F2FS_ENC_STRICT_MODE_FL, "strict" }, + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} }; /* Return a positive number < 0xff indicating the encoding magic number @@ -1485,6 +1486,11 @@ int f2fs_str2encoding_flags(char **param, __u16 *flags) *flags |= fl->flag; } + if (fl->flag == F2FS_ENC_NO_COMPAT_FALLBACK_FL) + c.nolinear_lookup = neg ? + LINEAR_LOOKUP_ENABLE : + LINEAR_LOOKUP_DISABLE; + goto next_flag; } } diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 index 8b3b0cc..9096646 100644 --- a/man/mkfs.f2fs.8 +++ b/man/mkfs.f2fs.8 @@ -232,10 +232,17 @@ Use UTF-8 for casefolding. .I flags: .RS 1.2i .TP 1.2i -.B strict +.B [no]strict This flag specifies that invalid strings should be rejected by the filesystem. Default is disabled. .RE +.RS 1.2i +.TP 1.2i +.B [no]hashonly +This flag specifies that linear lookup fallback is off during lookup, to turn +on linear lookup fallback, use nohashonly flag. +For android case, it will disable linear lookup by default. +.RE .RE .TP .BI \-q diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 2680bd3..04dfc20 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -671,6 +671,17 @@ static int f2fs_prepare_super_block(void) memcpy(sb->init_version, c.version, VERSION_LEN); if (c.feature & F2FS_FEATURE_CASEFOLD) { + /* + * if [no]hashonly option is not assigned, let's disable + * linear lookup fallback by default for Android case. + */ + if ((c.nolinear_lookup == LINEAR_LOOKUP_DEFAULT) && + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) { + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; + MSG(0, "Info: set default linear_lookup option: %s\n", + c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL ? + "disable" : "enable"); + } set_sb(s_encoding, c.s_encoding); set_sb(s_encoding_flags, c.s_encoding_flags); } diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index f0bec4f..8f8e975 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -143,7 +143,8 @@ static void add_default_options(void) force_overwrite = 1; c.wanted_sector_size = F2FS_BLKSIZE; c.root_uid = c.root_gid = 0; - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | + F2FS_FEATURE_LINEAR_LOOKUP; /* RO doesn't need any other features */ if (c.feature & F2FS_FEATURE_RO) -- 2.49.0 |
From: Chao Yu <ch...@ke...> - 2025-07-28 02:03:08
|
On 7/28/25 09:05, Zhiguo Niu wrote: > Hi Chao > > Chao Yu via Linux-f2fs-devel <lin...@li...> > 于2025年7月25日周五 13:51写道: >> >> It provides a way to disable linear lookup fallback during mkfs. >> >> Behavior summary: >> Android Distro >> By default disabled enabled >> >> Android case: >> >> 1.1) Disable linear lookup: >> - mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb >> - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 2 : 2] >> >> 1.2) Enable linear lookup: >> - mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb >> - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 0 : 0] >> >> 1.3) By default: >> - mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb >> Info: set default linear_lookup option: disable >> - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 2 : 2] >> >> Distro case: >> >> 2.1) Disable linear lookup: >> - mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb >> - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 2 : 2] >> >> 2.2) Enable linear lookup: >> - mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb >> - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 0 : 0] >> >> 2.3) By default: >> - mkfs.f2fs -f -O casefold -C utf8 /dev/vdb >> - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 0 : 0] >> > It is very clear and easy to understand. >> Signed-off-by: Chao Yu <ch...@ke...> >> --- >> v3: >> - honor [no]hashonly flag for Android case >> - update testcase and output >> include/f2fs_fs.h | 3 ++- >> lib/libf2fs.c | 6 ++++++ >> man/mkfs.f2fs.8 | 9 ++++++++- >> mkfs/f2fs_format.c | 11 +++++++++++ >> mkfs/f2fs_format_main.c | 3 ++- >> 5 files changed, 29 insertions(+), 3 deletions(-) >> >> diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h >> index f7268d1..a8da8fa 100644 >> --- a/include/f2fs_fs.h >> +++ b/include/f2fs_fs.h >> @@ -1478,7 +1478,8 @@ enum { >> >> /* feature list in Android */ >> enum { >> - F2FS_FEATURE_NAT_BITS = 0x0001, >> + F2FS_FEATURE_NAT_BITS = 0x0001, >> + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, >> }; >> >> /* nolinear lookup tune */ >> diff --git a/lib/libf2fs.c b/lib/libf2fs.c >> index 2f012c8..1a496b7 100644 >> --- a/lib/libf2fs.c >> +++ b/lib/libf2fs.c >> @@ -1424,6 +1424,7 @@ static const struct enc_flags { >> char *param; >> } encoding_flags[] = { >> { F2FS_ENC_STRICT_MODE_FL, "strict" }, >> + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} >> }; >> >> /* Return a positive number < 0xff indicating the encoding magic number >> @@ -1485,6 +1486,11 @@ int f2fs_str2encoding_flags(char **param, __u16 *flags) >> *flags |= fl->flag; >> } >> >> + if (fl->flag == F2FS_ENC_NO_COMPAT_FALLBACK_FL) >> + c.nolinear_lookup = neg ? >> + LINEAR_LOOKUP_ENABLE : >> + LINEAR_LOOKUP_DISABLE; >> + >> goto next_flag; >> } >> } >> diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 >> index 8b3b0cc..fcb227c 100644 >> --- a/man/mkfs.f2fs.8 >> +++ b/man/mkfs.f2fs.8 >> @@ -232,10 +232,17 @@ Use UTF-8 for casefolding. >> .I flags: >> .RS 1.2i >> .TP 1.2i >> -.B strict >> +.B [no]strict >> This flag specifies that invalid strings should be rejected by the filesystem. >> Default is disabled. >> .RE >> +.RS 1.2i >> +.TP 1.2i >> +.B [no]hashonly >> +This flag specifies that linear lookup fallback is off during lookup, to turn >> +off linear lookup fallback, use nohashonly flag. > here should "to turn off linear lookup fallback, use hashonly flag"? > or "to turn on linear lookup fallback, use nohashonly flag" Zhiguo, Yes, it's typo, let me fix it, thanks for the review. Thanks, > 1.1) Disable linear lookup: > - mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb > >> +For android case, it will disable linear lookup by default. >> +.RE >> .RE >> .TP >> .BI \-q >> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c >> index 2680bd3..04dfc20 100644 >> --- a/mkfs/f2fs_format.c >> +++ b/mkfs/f2fs_format.c >> @@ -671,6 +671,17 @@ static int f2fs_prepare_super_block(void) >> memcpy(sb->init_version, c.version, VERSION_LEN); >> >> if (c.feature & F2FS_FEATURE_CASEFOLD) { >> + /* >> + * if [no]hashonly option is not assigned, let's disable >> + * linear lookup fallback by default for Android case. >> + */ >> + if ((c.nolinear_lookup == LINEAR_LOOKUP_DEFAULT) && >> + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) { >> + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; >> + MSG(0, "Info: set default linear_lookup option: %s\n", >> + c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL ? >> + "disable" : "enable"); >> + } >> set_sb(s_encoding, c.s_encoding); >> set_sb(s_encoding_flags, c.s_encoding_flags); >> } >> diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c >> index f0bec4f..8f8e975 100644 >> --- a/mkfs/f2fs_format_main.c >> +++ b/mkfs/f2fs_format_main.c >> @@ -143,7 +143,8 @@ static void add_default_options(void) >> force_overwrite = 1; >> c.wanted_sector_size = F2FS_BLKSIZE; >> c.root_uid = c.root_gid = 0; >> - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; >> + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | >> + F2FS_FEATURE_LINEAR_LOOKUP; >> >> /* RO doesn't need any other features */ >> if (c.feature & F2FS_FEATURE_RO) > others look OK to me,so > Reviewed-by: Zhiguo Niu <zhi...@un...> >> -- >> 2.49.0 >> >> >> >> _______________________________________________ >> Linux-f2fs-devel mailing list >> Lin...@li... >> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel |
From: Zhiguo N. <niu...@gm...> - 2025-07-28 01:05:25
|
Hi Chao Chao Yu via Linux-f2fs-devel <lin...@li...> 于2025年7月25日周五 13:51写道: > > It provides a way to disable linear lookup fallback during mkfs. > > Behavior summary: > Android Distro > By default disabled enabled > > Android case: > > 1.1) Disable linear lookup: > - mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb > - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 2 : 2] > > 1.2) Enable linear lookup: > - mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb > - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 0 : 0] > > 1.3) By default: > - mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb > Info: set default linear_lookup option: disable > - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 2 : 2] > > Distro case: > > 2.1) Disable linear lookup: > - mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb > - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 2 : 2] > > 2.2) Enable linear lookup: > - mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb > - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 0 : 0] > > 2.3) By default: > - mkfs.f2fs -f -O casefold -C utf8 /dev/vdb > - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 0 : 0] > It is very clear and easy to understand. > Signed-off-by: Chao Yu <ch...@ke...> > --- > v3: > - honor [no]hashonly flag for Android case > - update testcase and output > include/f2fs_fs.h | 3 ++- > lib/libf2fs.c | 6 ++++++ > man/mkfs.f2fs.8 | 9 ++++++++- > mkfs/f2fs_format.c | 11 +++++++++++ > mkfs/f2fs_format_main.c | 3 ++- > 5 files changed, 29 insertions(+), 3 deletions(-) > > diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > index f7268d1..a8da8fa 100644 > --- a/include/f2fs_fs.h > +++ b/include/f2fs_fs.h > @@ -1478,7 +1478,8 @@ enum { > > /* feature list in Android */ > enum { > - F2FS_FEATURE_NAT_BITS = 0x0001, > + F2FS_FEATURE_NAT_BITS = 0x0001, > + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, > }; > > /* nolinear lookup tune */ > diff --git a/lib/libf2fs.c b/lib/libf2fs.c > index 2f012c8..1a496b7 100644 > --- a/lib/libf2fs.c > +++ b/lib/libf2fs.c > @@ -1424,6 +1424,7 @@ static const struct enc_flags { > char *param; > } encoding_flags[] = { > { F2FS_ENC_STRICT_MODE_FL, "strict" }, > + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} > }; > > /* Return a positive number < 0xff indicating the encoding magic number > @@ -1485,6 +1486,11 @@ int f2fs_str2encoding_flags(char **param, __u16 *flags) > *flags |= fl->flag; > } > > + if (fl->flag == F2FS_ENC_NO_COMPAT_FALLBACK_FL) > + c.nolinear_lookup = neg ? > + LINEAR_LOOKUP_ENABLE : > + LINEAR_LOOKUP_DISABLE; > + > goto next_flag; > } > } > diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 > index 8b3b0cc..fcb227c 100644 > --- a/man/mkfs.f2fs.8 > +++ b/man/mkfs.f2fs.8 > @@ -232,10 +232,17 @@ Use UTF-8 for casefolding. > .I flags: > .RS 1.2i > .TP 1.2i > -.B strict > +.B [no]strict > This flag specifies that invalid strings should be rejected by the filesystem. > Default is disabled. > .RE > +.RS 1.2i > +.TP 1.2i > +.B [no]hashonly > +This flag specifies that linear lookup fallback is off during lookup, to turn > +off linear lookup fallback, use nohashonly flag. here should "to turn off linear lookup fallback, use hashonly flag"? or "to turn on linear lookup fallback, use nohashonly flag" 1.1) Disable linear lookup: - mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb > +For android case, it will disable linear lookup by default. > +.RE > .RE > .TP > .BI \-q > diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > index 2680bd3..04dfc20 100644 > --- a/mkfs/f2fs_format.c > +++ b/mkfs/f2fs_format.c > @@ -671,6 +671,17 @@ static int f2fs_prepare_super_block(void) > memcpy(sb->init_version, c.version, VERSION_LEN); > > if (c.feature & F2FS_FEATURE_CASEFOLD) { > + /* > + * if [no]hashonly option is not assigned, let's disable > + * linear lookup fallback by default for Android case. > + */ > + if ((c.nolinear_lookup == LINEAR_LOOKUP_DEFAULT) && > + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) { > + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; > + MSG(0, "Info: set default linear_lookup option: %s\n", > + c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL ? > + "disable" : "enable"); > + } > set_sb(s_encoding, c.s_encoding); > set_sb(s_encoding_flags, c.s_encoding_flags); > } > diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c > index f0bec4f..8f8e975 100644 > --- a/mkfs/f2fs_format_main.c > +++ b/mkfs/f2fs_format_main.c > @@ -143,7 +143,8 @@ static void add_default_options(void) > force_overwrite = 1; > c.wanted_sector_size = F2FS_BLKSIZE; > c.root_uid = c.root_gid = 0; > - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; > + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | > + F2FS_FEATURE_LINEAR_LOOKUP; > > /* RO doesn't need any other features */ > if (c.feature & F2FS_FEATURE_RO) others look OK to me,so Reviewed-by: Zhiguo Niu <zhi...@un...> > -- > 2.49.0 > > > > _______________________________________________ > Linux-f2fs-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel |
From: Qi H. <ha...@vi...> - 2025-07-25 07:31:45
|
Jens has already completed the development of uncached buffered I/O in git [1], and in f2fs, uncached buffered I/O read can be enabled simply by setting the FOP_DONTCACHE flag in f2fs_file_operations. I have been testing a use case locally, which aligns with Jens' test case [2]. In the read scenario, using uncached buffer I/O results in more stable read performance and a lower load on the background memory reclaim thread (kswapd). So let's enable uncached buffer I/O reads on F2FS. Read test data without using uncached buffer I/O: reading bs 32768, uncached 0 1s: 1856MB/sec, MB=1856 2s: 1907MB/sec, MB=3763 3s: 1830MB/sec, MB=5594 4s: 1745MB/sec, MB=7333 5s: 1829MB/sec, MB=9162 6s: 1903MB/sec, MB=11075 7s: 1878MB/sec, MB=12942 8s: 1763MB/sec, MB=14718 9s: 1845MB/sec, MB=16549 10s: 1915MB/sec, MB=18481 11s: 1831MB/sec, MB=20295 12s: 1750MB/sec, MB=22066 13s: 1787MB/sec, MB=23832 14s: 1913MB/sec, MB=25769 15s: 1898MB/sec, MB=27668 16s: 1795MB/sec, MB=29436 17s: 1812MB/sec, MB=31248 18s: 1890MB/sec, MB=33139 19s: 1880MB/sec, MB=35020 20s: 1754MB/sec, MB=36810 08:36:26 UID PID %usr %system %guest %wait %CPU CPU Command 08:36:27 0 93 0.00 0.00 0.00 0.00 0.00 7 kswapd0 08:36:28 0 93 0.00 0.00 0.00 0.00 0.00 7 kswapd0 08:36:29 0 93 0.00 0.00 0.00 0.00 0.00 7 kswapd0 08:36:30 0 93 0.00 56.00 0.00 0.00 56.00 7 kswapd0 08:36:31 0 93 0.00 73.00 0.00 0.00 73.00 7 kswapd0 08:36:32 0 93 0.00 83.00 0.00 0.00 83.00 7 kswapd0 08:36:33 0 93 0.00 75.00 0.00 0.00 75.00 7 kswapd0 08:36:34 0 93 0.00 81.00 0.00 0.00 81.00 7 kswapd0 08:36:35 0 93 0.00 54.00 0.00 1.00 54.00 2 kswapd0 08:36:36 0 93 0.00 61.00 0.00 0.00 61.00 0 kswapd0 08:36:37 0 93 0.00 68.00 0.00 0.00 68.00 7 kswapd0 08:36:38 0 93 0.00 53.00 0.00 0.00 53.00 2 kswapd0 08:36:39 0 93 0.00 82.00 0.00 0.00 82.00 7 kswapd0 08:36:40 0 93 0.00 77.00 0.00 0.00 77.00 1 kswapd0 08:36:41 0 93 0.00 74.00 0.00 1.00 74.00 7 kswapd0 08:36:42 0 93 0.00 71.00 0.00 0.00 71.00 7 kswapd0 08:36:43 0 93 0.00 78.00 0.00 0.00 78.00 7 kswapd0 08:36:44 0 93 0.00 85.00 0.00 0.00 85.00 7 kswapd0 08:36:45 0 93 0.00 83.00 0.00 0.00 83.00 7 kswapd0 08:36:46 0 93 0.00 70.00 0.00 0.00 70.00 7 kswapd0 08:36:47 0 93 0.00 78.00 0.00 1.00 78.00 2 kswapd0 08:36:48 0 93 0.00 81.00 0.00 0.00 81.00 3 kswapd0 08:36:49 0 93 0.00 54.00 0.00 0.00 54.00 7 kswapd0 08:36:50 0 93 0.00 76.00 0.00 0.00 76.00 1 kswapd0 08:36:51 0 93 0.00 75.00 0.00 0.00 75.00 0 kswapd0 08:36:52 0 93 0.00 73.00 0.00 0.00 73.00 7 kswapd0 08:36:53 0 93 0.00 61.00 0.00 1.00 61.00 7 kswapd0 08:36:54 0 93 0.00 80.00 0.00 0.00 80.00 7 kswapd0 08:36:55 0 93 0.00 64.00 0.00 0.00 64.00 7 kswapd0 08:36:56 0 93 0.00 56.00 0.00 0.00 56.00 7 kswapd0 08:36:57 0 93 0.00 26.00 0.00 0.00 26.00 2 kswapd0 08:36:58 0 93 0.00 24.00 0.00 1.00 24.00 3 kswapd0 08:36:59 0 93 0.00 22.00 0.00 1.00 22.00 3 kswapd0 08:37:00 0 93 0.00 15.84 0.00 0.00 15.84 3 kswapd0 08:37:01 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 08:37:02 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 Read test data after using uncached buffer I/O: reading bs 32768, uncached 1 1s: 1863MB/sec, MB=1863 2s: 1903MB/sec, MB=3766 3s: 1860MB/sec, MB=5627 4s: 1864MB/sec, MB=7491 5s: 1860MB/sec, MB=9352 6s: 1854MB/sec, MB=11206 7s: 1874MB/sec, MB=13081 8s: 1874MB/sec, MB=14943 9s: 1840MB/sec, MB=16798 10s: 1849MB/sec, MB=18647 11s: 1863MB/sec, MB=20511 12s: 1798MB/sec, MB=22310 13s: 1897MB/sec, MB=24207 14s: 1817MB/sec, MB=26025 15s: 1893MB/sec, MB=27918 16s: 1917MB/sec, MB=29836 17s: 1863MB/sec, MB=31699 18s: 1904MB/sec, MB=33604 19s: 1894MB/sec, MB=35499 20s: 1907MB/sec, MB=37407 08:38:00 UID PID %usr %system %guest %wait %CPU CPU Command 08:38:01 0 93 0.00 0.00 0.00 0.00 0.00 4 kswapd0 08:38:02 0 93 0.00 0.00 0.00 0.00 0.00 4 kswapd0 08:38:03 0 93 0.00 0.00 0.00 0.00 0.00 4 kswapd0 08:38:04 0 93 0.00 0.00 0.00 0.00 0.00 4 kswapd0 08:38:05 0 93 0.00 0.00 0.00 0.00 0.00 4 kswapd0 08:38:06 0 93 0.00 1.00 0.00 1.00 1.00 0 kswapd0 08:38:07 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:08 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:09 0 93 0.00 1.00 0.00 0.00 1.00 1 kswapd0 08:38:10 0 93 0.00 0.00 0.00 0.00 0.00 1 kswapd0 08:38:11 0 93 0.00 0.00 0.00 0.00 0.00 1 kswapd0 08:38:12 0 93 0.00 0.00 0.00 0.00 0.00 1 kswapd0 08:38:13 0 93 0.00 0.00 0.00 0.00 0.00 1 kswapd0 08:38:14 0 93 0.00 0.00 0.00 0.00 0.00 1 kswapd0 08:38:15 0 93 0.00 3.00 0.00 0.00 3.00 0 kswapd0 08:38:16 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:17 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:18 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:19 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:20 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:21 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:22 0 93 0.00 0.00 0.00 0.00 0.00 0 kswapd0 08:38:23 0 93 0.00 3.00 0.00 0.00 3.00 4 kswapd0 08:38:24 0 93 0.00 0.00 0.00 0.00 0.00 4 kswapd0 08:38:25 0 93 0.00 0.00 0.00 0.00 0.00 4 kswapd0 08:38:26 0 93 0.00 4.00 0.00 0.00 4.00 3 kswapd0 08:38:27 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 08:38:28 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 08:38:29 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 08:38:30 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 08:38:31 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 08:38:32 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 08:38:33 0 93 0.00 0.00 0.00 0.00 0.00 3 kswapd0 [1] https://lore.kernel.org/all/202...@ke.../T/#m58520a94b46f543d82db3711453dfc7bb594b2b0 [2] https://pastebin.com/u8eCBzB5 Signed-off-by: Qi Han <ha...@vi...> --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 696131e655ed..d8da1fc2febf 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -5425,5 +5425,5 @@ const struct file_operations f2fs_file_operations = { .splice_read = f2fs_file_splice_read, .splice_write = iter_file_splice_write, .fadvise = f2fs_file_fadvise, - .fop_flags = FOP_BUFFER_RASYNC, + .fop_flags = FOP_BUFFER_RASYNC | FOP_DONTCACHE, }; -- 2.48.1 |
From: Chao Yu <ch...@ke...> - 2025-07-25 05:52:32
|
Behavior summary: Android Distro By default disabled enabled Android case: 1) enabled -> disabled - mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] - fsck.f2fs -g android --nolinear-lookup=1 /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] - mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] - fsck.f2fs -g android /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 2) disabled -> enabled - mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] - fsck.f2fs -g android --nolinear-lookup=0 /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] Distro case: 1) enabled -> disabled - mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] - fsck.f2fs --nolinear-lookup=1 /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 2) disabled -> enabled - mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] - fsck.f2fs --nolinear-lookup=0 /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] 3) default - mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] - fsck.f2fs /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] - mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] - fsck.f2fs /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] Signed-off-by: Chao Yu <ch...@ke...> --- fsck/fsck.c | 9 +++++++++ fsck/main.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index bb39f8b..4c36dc1 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -2425,6 +2425,15 @@ void fsck_update_sb_flags(struct f2fs_sb_info *sbi) struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); u16 flags = get_sb(s_encoding_flags); + /* handle default option for Android case */ + if ((c.nolinear_lookup == LINEAR_LOOKUP_DEFAULT) && + c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP) { + c.nolinear_lookup = LINEAR_LOOKUP_DISABLE; + MSG(0, "Info: set default linear_lookup option: %s\n", + c.nolinear_lookup == LINEAR_LOOKUP_DISABLE ? + "disable" : "enable"); + } + if (c.nolinear_lookup == LINEAR_LOOKUP_DEFAULT) { MSG(0, "Info: Casefold: linear_lookup [%s]\n", get_sb(s_encoding_flags) & F2FS_ENC_NO_COMPAT_FALLBACK_FL ? diff --git a/fsck/main.c b/fsck/main.c index e05c23a..324629e 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -226,7 +226,7 @@ static void add_default_options(void) c.auto_fix = 1; /* disable linear lookup by default */ - c.nolinear_lookup = LINEAR_LOOKUP_DISABLE; + c.disabled_feature |= F2FS_FEATURE_LINEAR_LOOKUP; } else if (c.func == RESIZE) { c.force = 1; } -- 2.49.0 |
From: Chao Yu <ch...@ke...> - 2025-07-25 05:50:21
|
It provides a way to disable linear lookup fallback during mkfs. Behavior summary: Android Distro By default disabled enabled Android case: 1.1) Disable linear lookup: - mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 1.2) Enable linear lookup: - mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] 1.3) By default: - mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb Info: set default linear_lookup option: disable - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] Distro case: 2.1) Disable linear lookup: - mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 2.2) Enable linear lookup: - mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] 2.3) By default: - mkfs.f2fs -f -O casefold -C utf8 /dev/vdb - dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] Signed-off-by: Chao Yu <ch...@ke...> --- v3: - honor [no]hashonly flag for Android case - update testcase and output include/f2fs_fs.h | 3 ++- lib/libf2fs.c | 6 ++++++ man/mkfs.f2fs.8 | 9 ++++++++- mkfs/f2fs_format.c | 11 +++++++++++ mkfs/f2fs_format_main.c | 3 ++- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index f7268d1..a8da8fa 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -1478,7 +1478,8 @@ enum { /* feature list in Android */ enum { - F2FS_FEATURE_NAT_BITS = 0x0001, + F2FS_FEATURE_NAT_BITS = 0x0001, + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, }; /* nolinear lookup tune */ diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 2f012c8..1a496b7 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -1424,6 +1424,7 @@ static const struct enc_flags { char *param; } encoding_flags[] = { { F2FS_ENC_STRICT_MODE_FL, "strict" }, + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} }; /* Return a positive number < 0xff indicating the encoding magic number @@ -1485,6 +1486,11 @@ int f2fs_str2encoding_flags(char **param, __u16 *flags) *flags |= fl->flag; } + if (fl->flag == F2FS_ENC_NO_COMPAT_FALLBACK_FL) + c.nolinear_lookup = neg ? + LINEAR_LOOKUP_ENABLE : + LINEAR_LOOKUP_DISABLE; + goto next_flag; } } diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 index 8b3b0cc..fcb227c 100644 --- a/man/mkfs.f2fs.8 +++ b/man/mkfs.f2fs.8 @@ -232,10 +232,17 @@ Use UTF-8 for casefolding. .I flags: .RS 1.2i .TP 1.2i -.B strict +.B [no]strict This flag specifies that invalid strings should be rejected by the filesystem. Default is disabled. .RE +.RS 1.2i +.TP 1.2i +.B [no]hashonly +This flag specifies that linear lookup fallback is off during lookup, to turn +off linear lookup fallback, use nohashonly flag. +For android case, it will disable linear lookup by default. +.RE .RE .TP .BI \-q diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 2680bd3..04dfc20 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -671,6 +671,17 @@ static int f2fs_prepare_super_block(void) memcpy(sb->init_version, c.version, VERSION_LEN); if (c.feature & F2FS_FEATURE_CASEFOLD) { + /* + * if [no]hashonly option is not assigned, let's disable + * linear lookup fallback by default for Android case. + */ + if ((c.nolinear_lookup == LINEAR_LOOKUP_DEFAULT) && + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) { + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; + MSG(0, "Info: set default linear_lookup option: %s\n", + c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL ? + "disable" : "enable"); + } set_sb(s_encoding, c.s_encoding); set_sb(s_encoding_flags, c.s_encoding_flags); } diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index f0bec4f..8f8e975 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -143,7 +143,8 @@ static void add_default_options(void) force_overwrite = 1; c.wanted_sector_size = F2FS_BLKSIZE; c.root_uid = c.root_gid = 0; - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | + F2FS_FEATURE_LINEAR_LOOKUP; /* RO doesn't need any other features */ if (c.feature & F2FS_FEATURE_RO) -- 2.49.0 |
From: Zhiguo N. <niu...@gm...> - 2025-07-25 03:05:19
|
Chao Yu <ch...@ke...> 于2025年7月25日周五 10:45写道: > > On 7/25/2025 10:08 AM, Zhiguo Niu wrote: > > Chao Yu via Linux-f2fs-devel <lin...@li...> > > 于2025年7月25日周五 09:03写道: > >> > >> It provides a way to disable linear lookup fallback during mkfs. > >> > >> Behavior summary: > >> Android Distro > >> By default disabled enabled > >> Tune w/ [no]hashonly no yes > >> > >> Android case: > >> > >> 1.1) Disable linear lookup: > >> mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb > >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > >> s_encoding_flags [0x 2 : 2] > >> > >> 1.2) Enable linear lookup: > >> mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb > >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > >> s_encoding_flags [0x 2 : 2] > > Hi Chao, > > Seems like a typo here? should be: > > Zhiguo, > > Not a typo, it's intentional, see above behavior summary. > Hi Chao, Ah, I got it after checking again.^^ > But after rethinking about this, I guess it will be good to honor > 'nohashonly' for Android case like Distro case. > > Anyway, let me update the patch. Thanks for this and explanation. > > Thanks, > > > s_encoding_flags [0x 0 : 0] ? > > thanks! > >> > >> 1.3) By default: > >> mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb > >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > >> s_encoding_flags [0x 2 : 2] > >> > >> Distro case: > >> > >> 2.1) Disable linear lookup: > >> mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb > >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > >> s_encoding_flags [0x 2 : 2] > >> > >> 2.2) Enable linear lookup: > >> mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb > >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > >> s_encoding_flags [0x 0 : 0] > >> > >> 2.3) By default: > >> mkfs.f2fs -f -O casefold -C utf8 /dev/vdb > >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > >> s_encoding_flags [0x 0 : 0] > >> > >> Signed-off-by: Chao Yu <ch...@ke...> > >> --- > >> v2: > >> - disable linear lookup by default for Android case > >> include/f2fs_fs.h | 3 ++- > >> lib/libf2fs.c | 1 + > >> man/mkfs.f2fs.8 | 10 ++++++++-- > >> mkfs/f2fs_format.c | 3 +++ > >> mkfs/f2fs_format_main.c | 3 ++- > >> 5 files changed, 16 insertions(+), 4 deletions(-) > >> > >> diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > >> index f7268d1..a8da8fa 100644 > >> --- a/include/f2fs_fs.h > >> +++ b/include/f2fs_fs.h > >> @@ -1478,7 +1478,8 @@ enum { > >> > >> /* feature list in Android */ > >> enum { > >> - F2FS_FEATURE_NAT_BITS = 0x0001, > >> + F2FS_FEATURE_NAT_BITS = 0x0001, > >> + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, > >> }; > >> > >> /* nolinear lookup tune */ > >> diff --git a/lib/libf2fs.c b/lib/libf2fs.c > >> index 2f012c8..0e3e62a 100644 > >> --- a/lib/libf2fs.c > >> +++ b/lib/libf2fs.c > >> @@ -1424,6 +1424,7 @@ static const struct enc_flags { > >> char *param; > >> } encoding_flags[] = { > >> { F2FS_ENC_STRICT_MODE_FL, "strict" }, > >> + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} > >> }; > >> > >> /* Return a positive number < 0xff indicating the encoding magic number > >> diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 > >> index 8b3b0cc..8cb7d32 100644 > >> --- a/man/mkfs.f2fs.8 > >> +++ b/man/mkfs.f2fs.8 > >> @@ -232,9 +232,15 @@ Use UTF-8 for casefolding. > >> .I flags: > >> .RS 1.2i > >> .TP 1.2i > >> -.B strict > >> +.B [no]strict > >> This flag specifies that invalid strings should be rejected by the filesystem. > >> -Default is disabled. > >> +For android case, it will disable linear lookup by default. > >> +.RE > >> +.RS 1.2i > >> +.TP 1.2i > >> +.B [no]hashonly > >> +This flag specifies that there is no linear lookup fallback during lookup. > >> +By default, linear lookup fallback is enabled. > >> .RE > >> .RE > >> .TP > >> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > >> index 2680bd3..a45bbcb 100644 > >> --- a/mkfs/f2fs_format.c > >> +++ b/mkfs/f2fs_format.c > >> @@ -671,6 +671,9 @@ static int f2fs_prepare_super_block(void) > >> memcpy(sb->init_version, c.version, VERSION_LEN); > >> > >> if (c.feature & F2FS_FEATURE_CASEFOLD) { > >> + if (!(c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL) && > >> + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) > >> + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; > >> set_sb(s_encoding, c.s_encoding); > >> set_sb(s_encoding_flags, c.s_encoding_flags); > >> } > >> diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c > >> index f0bec4f..8f8e975 100644 > >> --- a/mkfs/f2fs_format_main.c > >> +++ b/mkfs/f2fs_format_main.c > >> @@ -143,7 +143,8 @@ static void add_default_options(void) > >> force_overwrite = 1; > >> c.wanted_sector_size = F2FS_BLKSIZE; > >> c.root_uid = c.root_gid = 0; > >> - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; > >> + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | > >> + F2FS_FEATURE_LINEAR_LOOKUP; > >> > >> /* RO doesn't need any other features */ > >> if (c.feature & F2FS_FEATURE_RO) > >> -- > >> 2.49.0 > >> > >> > >> > >> _______________________________________________ > >> Linux-f2fs-devel mailing list > >> Lin...@li... > >> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > |
From: Chao Yu <ch...@ke...> - 2025-07-25 02:46:06
|
On 7/25/2025 10:08 AM, Zhiguo Niu wrote: > Chao Yu via Linux-f2fs-devel <lin...@li...> > 于2025年7月25日周五 09:03写道: >> >> It provides a way to disable linear lookup fallback during mkfs. >> >> Behavior summary: >> Android Distro >> By default disabled enabled >> Tune w/ [no]hashonly no yes >> >> Android case: >> >> 1.1) Disable linear lookup: >> mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 2 : 2] >> >> 1.2) Enable linear lookup: >> mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 2 : 2] > Hi Chao, > Seems like a typo here? should be: Zhiguo, Not a typo, it's intentional, see above behavior summary. But after rethinking about this, I guess it will be good to honor 'nohashonly' for Android case like Distro case. Anyway, let me update the patch. Thanks, > s_encoding_flags [0x 0 : 0] ? > thanks! >> >> 1.3) By default: >> mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 2 : 2] >> >> Distro case: >> >> 2.1) Disable linear lookup: >> mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 2 : 2] >> >> 2.2) Enable linear lookup: >> mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 0 : 0] >> >> 2.3) By default: >> mkfs.f2fs -f -O casefold -C utf8 /dev/vdb >> dump.f2fs -d3 /dev/vdb |grep s_encoding_flags >> s_encoding_flags [0x 0 : 0] >> >> Signed-off-by: Chao Yu <ch...@ke...> >> --- >> v2: >> - disable linear lookup by default for Android case >> include/f2fs_fs.h | 3 ++- >> lib/libf2fs.c | 1 + >> man/mkfs.f2fs.8 | 10 ++++++++-- >> mkfs/f2fs_format.c | 3 +++ >> mkfs/f2fs_format_main.c | 3 ++- >> 5 files changed, 16 insertions(+), 4 deletions(-) >> >> diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h >> index f7268d1..a8da8fa 100644 >> --- a/include/f2fs_fs.h >> +++ b/include/f2fs_fs.h >> @@ -1478,7 +1478,8 @@ enum { >> >> /* feature list in Android */ >> enum { >> - F2FS_FEATURE_NAT_BITS = 0x0001, >> + F2FS_FEATURE_NAT_BITS = 0x0001, >> + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, >> }; >> >> /* nolinear lookup tune */ >> diff --git a/lib/libf2fs.c b/lib/libf2fs.c >> index 2f012c8..0e3e62a 100644 >> --- a/lib/libf2fs.c >> +++ b/lib/libf2fs.c >> @@ -1424,6 +1424,7 @@ static const struct enc_flags { >> char *param; >> } encoding_flags[] = { >> { F2FS_ENC_STRICT_MODE_FL, "strict" }, >> + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} >> }; >> >> /* Return a positive number < 0xff indicating the encoding magic number >> diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 >> index 8b3b0cc..8cb7d32 100644 >> --- a/man/mkfs.f2fs.8 >> +++ b/man/mkfs.f2fs.8 >> @@ -232,9 +232,15 @@ Use UTF-8 for casefolding. >> .I flags: >> .RS 1.2i >> .TP 1.2i >> -.B strict >> +.B [no]strict >> This flag specifies that invalid strings should be rejected by the filesystem. >> -Default is disabled. >> +For android case, it will disable linear lookup by default. >> +.RE >> +.RS 1.2i >> +.TP 1.2i >> +.B [no]hashonly >> +This flag specifies that there is no linear lookup fallback during lookup. >> +By default, linear lookup fallback is enabled. >> .RE >> .RE >> .TP >> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c >> index 2680bd3..a45bbcb 100644 >> --- a/mkfs/f2fs_format.c >> +++ b/mkfs/f2fs_format.c >> @@ -671,6 +671,9 @@ static int f2fs_prepare_super_block(void) >> memcpy(sb->init_version, c.version, VERSION_LEN); >> >> if (c.feature & F2FS_FEATURE_CASEFOLD) { >> + if (!(c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL) && >> + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) >> + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; >> set_sb(s_encoding, c.s_encoding); >> set_sb(s_encoding_flags, c.s_encoding_flags); >> } >> diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c >> index f0bec4f..8f8e975 100644 >> --- a/mkfs/f2fs_format_main.c >> +++ b/mkfs/f2fs_format_main.c >> @@ -143,7 +143,8 @@ static void add_default_options(void) >> force_overwrite = 1; >> c.wanted_sector_size = F2FS_BLKSIZE; >> c.root_uid = c.root_gid = 0; >> - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; >> + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | >> + F2FS_FEATURE_LINEAR_LOOKUP; >> >> /* RO doesn't need any other features */ >> if (c.feature & F2FS_FEATURE_RO) >> -- >> 2.49.0 >> >> >> >> _______________________________________________ >> Linux-f2fs-devel mailing list >> Lin...@li... >> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel |
From: Chao Yu <ch...@ke...> - 2025-07-25 02:37:51
|
On 7/25/2025 9:44 AM, hanqi wrote: > > > 在 2025/7/24 21:09, Chao Yu 写道: >> On 2025/7/16 16:27, hanqi wrote: >>> >>> >>> 在 2025/7/16 11:43, Jens Axboe 写道: >>>> On 7/15/25 9:34 PM, hanqi wrote: >>>>> >>>>> ? 2025/7/15 22:28, Jens Axboe ??: >>>>>> On 7/14/25 9:10 PM, Qi Han wrote: >>>>>>> Jens has already completed the development of uncached buffered I/O >>>>>>> in git [1], and in f2fs, the feature can be enabled simply by >>>>>>> setting >>>>>>> the FOP_DONTCACHE flag in f2fs_file_operations. >>>>>> You need to ensure that for any DONTCACHE IO that the completion is >>>>>> routed via non-irq context, if applicable. I didn't verify that >>>>>> this is >>>>>> the case for f2fs. Generally you can deduce this as well through >>>>>> testing, I'd say the following cases would be interesting to test: >>>>>> >>>>>> 1) Normal DONTCACHE buffered read >>>>>> 2) Overwrite DONTCACHE buffered write >>>>>> 3) Append DONTCACHE buffered write >>>>>> >>>>>> Test those with DEBUG_ATOMIC_SLEEP set in your config, and it that >>>>>> doesn't complain, that's a great start. >>>>>> >>>>>> For the above test cases as well, verify that page cache doesn't >>>>>> grow as >>>>>> IO is performed. A bit is fine for things like meta data, but >>>>>> generally >>>>>> you want to see it remain basically flat in terms of page cache >>>>>> usage. >>>>>> >>>>>> Maybe this is all fine, like I said I didn't verify. Just >>>>>> mentioning it >>>>>> for completeness sake. >>>>> Hi, Jens >>>>> Thanks for your suggestion. As I mentioned earlier in [1], in f2fs, >>>>> the regular buffered write path invokes folio_end_writeback from a >>>>> softirq context. Therefore, it seems that f2fs may not be suitable >>>>> for DONTCACHE I/O writes. >>>>> >>>>> I?d like to ask a question: why is DONTCACHE I/O write restricted to >>>>> non-interrupt context only? Is it because dropping the page might be >>>>> too time-consuming to be done safely in interrupt context? This might >>>>> be a naive question, but I?d really appreciate your clarification. >>>>> Thanks in advance. >>>> Because (as of right now, at least) the code doing the invalidation >>>> needs process context. There are various reasons for this, which you'll >>>> see if you follow the path off folio_end_writeback() -> >>>> filemap_end_dropbehind_write() -> filemap_end_dropbehind() -> >>>> folio_unmap_invalidate(). unmap_mapping_folio() is one case, and while >>>> that may be doable, the inode i_lock is not IRQ safe. >>>> >>>> Most file systems have a need to punt some writeback completions to >>>> non-irq context, eg for file extending etc. Hence for most file >>>> systems, >>>> the dontcache case just becomes another case that needs to go through >>>> that path. >>>> >>>> It'd certainly be possible to improve upon this, for example by having >>>> an opportunistic dontcache unmap from IRQ/soft-irq context, and then >>>> punting to a workqueue if that doesn't pan out. But this doesn't exist >>>> as of yet, hence the need for the workqueue punt. >> >> Thanks Jens for the detailed explanation. >> >>> >>> Hi, Jens >>> Thank you for your response. I tested uncached buffer I/O reads with >>> a 50GB dataset on a local F2FS filesystem, and the page cache size >>> only increased slightly, which I believe aligns with expectations. >>> After clearing the page cache, the page cache size returned to its >>> initial state. The test results are as follows: >>> >>> stat 50G.txt >>> File: 50G.txt >>> Size: 53687091200 Blocks: 104960712 IO Blocks: 512 >>> regular file >>> >>> [read before]: >>> echo 3 > /proc/sys/vm/drop_caches >>> 01:48:17 kbmemfree kbavail kbmemused %memused >>> kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty >>> 01:50:59 6404648 8149508 2719384 23.40 512 1898092 >>> 199384760 823.75 1846756 466832 44 >>> >>> ./uncached_io_test 8192 1 1 50G.txt >>> Starting 1 threads >>> reading bs 8192, uncached 1 >>> 1s: 754MB/sec, MB=754 >>> ... >>> 64s: 844MB/sec, MB=262144 >>> >>> [read after]: >>> 01:52:33 6326664 8121240 2747968 23.65 728 1947656 >>> 199384788 823.75 1887896 502004 68 >>> echo 3 > /proc/sys/vm/drop_caches >>> 01:53:11 6351136 8096936 2772400 23.86 512 1900500 >>> 199385216 823.75 1847252 533768 104 >>> >>> Hi Chao, >>> Given that F2FS currently calls folio_end_writeback in the softirq >>> context for normal write scenarios, could we first support uncached >>> buffer I/O reads? For normal uncached buffer I/O writes, would it be >>> feasible for F2FS to introduce an asynchronous workqueue to handle the >>> page drop operation in the future? What are your thoughts on this? >> >> Qi, >> >> Sorry for the delay. >> >> I think it will be good to support uncached buffered I/O in read path >> first, and then let's take a look what we can do for write path, anyway, >> let's do this step by step. >> >> Can you please update the patch? >> - support read path only >> - include test data in commit message > Chao > > I will re-submit a patch to first enable F2FS support for uncached > buffer I/O reads. Following that, I will work on implementing > asynchronous page dropping in F2FS. Qi, sure, please go ahead, thanks for the work. :) Thanks, > > Thank you! >> >>> Thank you! >>> >>> > |
From: Chao Yu <ch...@ke...> - 2025-07-25 02:36:56
|
On 7/25/2025 10:17 AM, wangzijie wrote: >> On 7/22/25 22:36, wangzijie wrote: >>> When we need to alloc nat entry and set it dirty, we can directly add it to >>> dirty set list(or initialize its list_head for new_ne) instead of adding it >>> to clean list and make a move. Introduce init_dirty flag to do it. >>> >>> Signed-off-by: wangzijie <wan...@ho...> >>> --- >>> fs/f2fs/node.c | 37 ++++++++++++++++++++++++++++++------- >>> 1 file changed, 30 insertions(+), 7 deletions(-) >>> >>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c >>> index a23db6238..20bcf8559 100644 >>> --- a/fs/f2fs/node.c >>> +++ b/fs/f2fs/node.c >>> @@ -185,7 +185,7 @@ static void __free_nat_entry(struct nat_entry *e) >>> >>> /* must be locked by nat_tree_lock */ >>> static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, >>> - struct nat_entry *ne, struct f2fs_nat_entry *raw_ne, bool no_fail) >>> + struct nat_entry *ne, struct f2fs_nat_entry *raw_ne, bool no_fail, bool init_dirty) >>> { >>> if (no_fail) >>> f2fs_radix_tree_insert(&nm_i->nat_root, nat_get_nid(ne), ne); >>> @@ -195,6 +195,11 @@ static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, >>> if (raw_ne) >>> node_info_from_raw_nat(&ne->ni, raw_ne); >>> >>> + if (init_dirty) { >>> + nm_i->nat_cnt[TOTAL_NAT]++; >>> + return ne; >>> + } >>> + >>> spin_lock(&nm_i->nat_list_lock); >>> list_add_tail(&ne->list, &nm_i->nat_entries); >>> spin_unlock(&nm_i->nat_list_lock); >>> @@ -256,7 +261,7 @@ static struct nat_entry_set *__grab_nat_entry_set(struct f2fs_nm_info *nm_i, >>> } >>> >>> static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, >>> - struct nat_entry *ne) >>> + struct nat_entry *ne, bool init_dirty) >>> { >>> struct nat_entry_set *head; >>> bool new_ne = nat_get_blkaddr(ne) == NEW_ADDR; >>> @@ -275,6 +280,18 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, >>> >>> set_nat_flag(ne, IS_PREALLOC, new_ne); >>> >>> + if (init_dirty) { >>> + nm_i->nat_cnt[DIRTY_NAT]++; >>> + set_nat_flag(ne, IS_DIRTY, true); >>> + spin_lock(&nm_i->nat_list_lock); >>> + if (new_ne) >>> + INIT_LIST_HEAD(&ne->list); >>> + else >>> + list_add_tail(&ne->list, &head->entry_list); >>> + spin_unlock(&nm_i->nat_list_lock); >>> + return; >>> + } >> >> Nit issue, above blanks should be replaced w/ tab. > > Ah...my bad :-( > >> Can we clean up like this? >> >> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c >> index de99b42437c6..60fc2c7b8e10 100644 >> --- a/fs/f2fs/node.c >> +++ b/fs/f2fs/node.c >> @@ -280,30 +280,23 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, >> >> set_nat_flag(ne, IS_PREALLOC, new_ne); >> >> - if (init_dirty) { >> - nm_i->nat_cnt[DIRTY_NAT]++; >> - set_nat_flag(ne, IS_DIRTY, true); >> - spin_lock(&nm_i->nat_list_lock); >> - if (new_ne) >> - INIT_LIST_HEAD(&ne->list); >> - else >> - list_add_tail(&ne->list, &head->entry_list); >> - spin_unlock(&nm_i->nat_list_lock); >> - return; >> - } >> - >> if (get_nat_flag(ne, IS_DIRTY)) >> goto refresh_list; >> >> nm_i->nat_cnt[DIRTY_NAT]++; >> - nm_i->nat_cnt[RECLAIMABLE_NAT]--; >> + if (!init_dirty) >> + nm_i->nat_cnt[RECLAIMABLE_NAT]--; >> set_nat_flag(ne, IS_DIRTY, true); >> refresh_list: >> spin_lock(&nm_i->nat_list_lock); >> - if (new_ne) >> - list_del_init(&ne->list); >> - else >> + if (new_ne) { >> + if (init_dirty) >> + INIT_LIST_HEAD(&ne->list); >> + else >> + list_del_init(&ne->list); >> + } else { >> list_move_tail(&ne->list, &head->entry_list); >> + } >> spin_unlock(&nm_i->nat_list_lock); >> } >> >> Thanks, > > We need to init list_head before using list_move_tail. > I think we can do more clean up like this, keep refresh_list part code. Ah, that's better. Thanks, > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > index 20bcf8559..ebb624fa1 100644 > --- a/fs/f2fs/node.c > +++ b/fs/f2fs/node.c > @@ -196,6 +196,7 @@ static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, > node_info_from_raw_nat(&ne->ni, raw_ne); > > if (init_dirty) { > + INIT_LIST_HEAD(&ne->list); > nm_i->nat_cnt[TOTAL_NAT]++; > return ne; > } > @@ -280,23 +281,12 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, > > set_nat_flag(ne, IS_PREALLOC, new_ne); > > - if (init_dirty) { > - nm_i->nat_cnt[DIRTY_NAT]++; > - set_nat_flag(ne, IS_DIRTY, true); > - spin_lock(&nm_i->nat_list_lock); > - if (new_ne) > - INIT_LIST_HEAD(&ne->list); > - else > - list_add_tail(&ne->list, &head->entry_list); > - spin_unlock(&nm_i->nat_list_lock); > - return; > - } > - > if (get_nat_flag(ne, IS_DIRTY)) > goto refresh_list; > > nm_i->nat_cnt[DIRTY_NAT]++; > - nm_i->nat_cnt[RECLAIMABLE_NAT]--; > + if (!init_dirty) > + nm_i->nat_cnt[RECLAIMABLE_NAT]--; > set_nat_flag(ne, IS_DIRTY, true); > refresh_list: > spin_lock(&nm_i->nat_list_lock); > >>> + >>> if (get_nat_flag(ne, IS_DIRTY)) >>> goto refresh_list; >>> >>> @@ -441,7 +458,7 @@ static void cache_nat_entry(struct f2fs_sb_info *sbi, nid_t nid, >>> f2fs_down_write(&nm_i->nat_tree_lock); >>> e = __lookup_nat_cache(nm_i, nid, false); >>> if (!e) >>> - e = __init_nat_entry(nm_i, new, ne, false); >>> + e = __init_nat_entry(nm_i, new, ne, false, false); >>> else >>> f2fs_bug_on(sbi, nat_get_ino(e) != le32_to_cpu(ne->ino) || >>> nat_get_blkaddr(e) != >>> @@ -458,11 +475,13 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, >>> struct f2fs_nm_info *nm_i = NM_I(sbi); >>> struct nat_entry *e; >>> struct nat_entry *new = __alloc_nat_entry(sbi, ni->nid, true); >>> + bool init_dirty = false; >>> >>> f2fs_down_write(&nm_i->nat_tree_lock); >>> e = __lookup_nat_cache(nm_i, ni->nid, true); >>> if (!e) { >>> - e = __init_nat_entry(nm_i, new, NULL, true); >>> + init_dirty = true; >>> + e = __init_nat_entry(nm_i, new, NULL, true, true); >>> copy_node_info(&e->ni, ni); >>> f2fs_bug_on(sbi, ni->blk_addr == NEW_ADDR); >>> } else if (new_blkaddr == NEW_ADDR) { >>> @@ -498,7 +517,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, >>> nat_set_blkaddr(e, new_blkaddr); >>> if (!__is_valid_data_blkaddr(new_blkaddr)) >>> set_nat_flag(e, IS_CHECKPOINTED, false); >>> - __set_nat_cache_dirty(nm_i, e); >>> + __set_nat_cache_dirty(nm_i, e, init_dirty); >>> >>> /* update fsync_mark if its inode nat entry is still alive */ >>> if (ni->nid != ni->ino) >>> @@ -2924,6 +2943,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) >>> struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_HOT_DATA); >>> struct f2fs_journal *journal = curseg->journal; >>> int i; >>> + bool init_dirty; >>> >>> down_write(&curseg->journal_rwsem); >>> for (i = 0; i < nats_in_cursum(journal); i++) { >>> @@ -2934,12 +2954,15 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) >>> if (f2fs_check_nid_range(sbi, nid)) >>> continue; >>> >>> + init_dirty = false; >>> + >>> raw_ne = nat_in_journal(journal, i); >>> >>> ne = __lookup_nat_cache(nm_i, nid, true); >>> if (!ne) { >>> + init_dirty = true; >>> ne = __alloc_nat_entry(sbi, nid, true); >>> - __init_nat_entry(nm_i, ne, &raw_ne, true); >>> + __init_nat_entry(nm_i, ne, &raw_ne, true, true); >>> } >>> >>> /* >>> @@ -2954,7 +2977,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) >>> spin_unlock(&nm_i->nid_list_lock); >>> } >>> >>> - __set_nat_cache_dirty(nm_i, ne); >>> + __set_nat_cache_dirty(nm_i, ne, init_dirty); >>> } >>> update_nats_in_cursum(journal, -i); >>> up_write(&curseg->journal_rwsem); > |
From: Chao Yu <ch...@ke...> - 2025-07-25 02:35:21
|
On 7/24/2025 11:59 PM, mason.zhang wrote: > Otherwise, the filesystem may unaware of potential file corruption. > > Signed-off-by: mason.zhang <mas...@gm...> > --- > fs/f2fs/segment.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index ae1223ef648f..ce80ba226aed 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -3936,12 +3936,15 @@ static void do_write_page(struct f2fs_summary *sum, struct f2fs_io_info *fio) > int seg_type = log_type_to_seg_type(type); > bool keep_order = (f2fs_lfs_mode(fio->sbi) && > seg_type == CURSEG_COLD_DATA); > + int err; > > if (keep_order) > f2fs_down_read(&fio->sbi->io_order_lock); > > - if (f2fs_allocate_data_block(fio->sbi, fio->page, fio->old_blkaddr, > - &fio->new_blkaddr, sum, type, fio)) { > + err = f2fs_allocate_data_block(fio->sbi, fio->page, fio->old_blkaddr, > + &fio->new_blkaddr, sum, type, fio); > + if (unlikely(err)) { > + f2fs_err(fio->sbi, "Failed to allocate data block(%d)", err); How about using f2fs_err_ratelimited() to avoid too many logs? Can you please dump more informations about inode, page, blkaddr...? Thanks, > if (fscrypt_inode_uses_fs_layer_crypto(folio->mapping->host)) > fscrypt_finalize_bounce_page(&fio->encrypted_page); > folio_end_writeback(folio); |
From: wangzijie <wan...@ho...> - 2025-07-25 02:17:47
|
> On 7/22/25 22:36, wangzijie wrote: > > When we need to alloc nat entry and set it dirty, we can directly add it to > > dirty set list(or initialize its list_head for new_ne) instead of adding it > > to clean list and make a move. Introduce init_dirty flag to do it. > > > > Signed-off-by: wangzijie <wan...@ho...> > > --- > > fs/f2fs/node.c | 37 ++++++++++++++++++++++++++++++------- > > 1 file changed, 30 insertions(+), 7 deletions(-) > > > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > > index a23db6238..20bcf8559 100644 > > --- a/fs/f2fs/node.c > > +++ b/fs/f2fs/node.c > > @@ -185,7 +185,7 @@ static void __free_nat_entry(struct nat_entry *e) > > > > /* must be locked by nat_tree_lock */ > > static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, > > - struct nat_entry *ne, struct f2fs_nat_entry *raw_ne, bool no_fail) > > + struct nat_entry *ne, struct f2fs_nat_entry *raw_ne, bool no_fail, bool init_dirty) > > { > > if (no_fail) > > f2fs_radix_tree_insert(&nm_i->nat_root, nat_get_nid(ne), ne); > > @@ -195,6 +195,11 @@ static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, > > if (raw_ne) > > node_info_from_raw_nat(&ne->ni, raw_ne); > > > > + if (init_dirty) { > > + nm_i->nat_cnt[TOTAL_NAT]++; > > + return ne; > > + } > > + > > spin_lock(&nm_i->nat_list_lock); > > list_add_tail(&ne->list, &nm_i->nat_entries); > > spin_unlock(&nm_i->nat_list_lock); > > @@ -256,7 +261,7 @@ static struct nat_entry_set *__grab_nat_entry_set(struct f2fs_nm_info *nm_i, > > } > > > > static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, > > - struct nat_entry *ne) > > + struct nat_entry *ne, bool init_dirty) > > { > > struct nat_entry_set *head; > > bool new_ne = nat_get_blkaddr(ne) == NEW_ADDR; > > @@ -275,6 +280,18 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, > > > > set_nat_flag(ne, IS_PREALLOC, new_ne); > > > > + if (init_dirty) { > > + nm_i->nat_cnt[DIRTY_NAT]++; > > + set_nat_flag(ne, IS_DIRTY, true); > > + spin_lock(&nm_i->nat_list_lock); > > + if (new_ne) > > + INIT_LIST_HEAD(&ne->list); > > + else > > + list_add_tail(&ne->list, &head->entry_list); > > + spin_unlock(&nm_i->nat_list_lock); > > + return; > > + } > > Nit issue, above blanks should be replaced w/ tab. Ah...my bad :-( > Can we clean up like this? > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > index de99b42437c6..60fc2c7b8e10 100644 > --- a/fs/f2fs/node.c > +++ b/fs/f2fs/node.c > @@ -280,30 +280,23 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, > > set_nat_flag(ne, IS_PREALLOC, new_ne); > > - if (init_dirty) { > - nm_i->nat_cnt[DIRTY_NAT]++; > - set_nat_flag(ne, IS_DIRTY, true); > - spin_lock(&nm_i->nat_list_lock); > - if (new_ne) > - INIT_LIST_HEAD(&ne->list); > - else > - list_add_tail(&ne->list, &head->entry_list); > - spin_unlock(&nm_i->nat_list_lock); > - return; > - } > - > if (get_nat_flag(ne, IS_DIRTY)) > goto refresh_list; > > nm_i->nat_cnt[DIRTY_NAT]++; > - nm_i->nat_cnt[RECLAIMABLE_NAT]--; > + if (!init_dirty) > + nm_i->nat_cnt[RECLAIMABLE_NAT]--; > set_nat_flag(ne, IS_DIRTY, true); > refresh_list: > spin_lock(&nm_i->nat_list_lock); > - if (new_ne) > - list_del_init(&ne->list); > - else > + if (new_ne) { > + if (init_dirty) > + INIT_LIST_HEAD(&ne->list); > + else > + list_del_init(&ne->list); > + } else { > list_move_tail(&ne->list, &head->entry_list); > + } > spin_unlock(&nm_i->nat_list_lock); > } > > Thanks, We need to init list_head before using list_move_tail. I think we can do more clean up like this, keep refresh_list part code. diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 20bcf8559..ebb624fa1 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -196,6 +196,7 @@ static struct nat_entry *__init_nat_entry(struct f2fs_nm_info *nm_i, node_info_from_raw_nat(&ne->ni, raw_ne); if (init_dirty) { + INIT_LIST_HEAD(&ne->list); nm_i->nat_cnt[TOTAL_NAT]++; return ne; } @@ -280,23 +281,12 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i, set_nat_flag(ne, IS_PREALLOC, new_ne); - if (init_dirty) { - nm_i->nat_cnt[DIRTY_NAT]++; - set_nat_flag(ne, IS_DIRTY, true); - spin_lock(&nm_i->nat_list_lock); - if (new_ne) - INIT_LIST_HEAD(&ne->list); - else - list_add_tail(&ne->list, &head->entry_list); - spin_unlock(&nm_i->nat_list_lock); - return; - } - if (get_nat_flag(ne, IS_DIRTY)) goto refresh_list; nm_i->nat_cnt[DIRTY_NAT]++; - nm_i->nat_cnt[RECLAIMABLE_NAT]--; + if (!init_dirty) + nm_i->nat_cnt[RECLAIMABLE_NAT]--; set_nat_flag(ne, IS_DIRTY, true); refresh_list: spin_lock(&nm_i->nat_list_lock); > > + > > if (get_nat_flag(ne, IS_DIRTY)) > > goto refresh_list; > > > > @@ -441,7 +458,7 @@ static void cache_nat_entry(struct f2fs_sb_info *sbi, nid_t nid, > > f2fs_down_write(&nm_i->nat_tree_lock); > > e = __lookup_nat_cache(nm_i, nid, false); > > if (!e) > > - e = __init_nat_entry(nm_i, new, ne, false); > > + e = __init_nat_entry(nm_i, new, ne, false, false); > > else > > f2fs_bug_on(sbi, nat_get_ino(e) != le32_to_cpu(ne->ino) || > > nat_get_blkaddr(e) != > > @@ -458,11 +475,13 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, > > struct f2fs_nm_info *nm_i = NM_I(sbi); > > struct nat_entry *e; > > struct nat_entry *new = __alloc_nat_entry(sbi, ni->nid, true); > > + bool init_dirty = false; > > > > f2fs_down_write(&nm_i->nat_tree_lock); > > e = __lookup_nat_cache(nm_i, ni->nid, true); > > if (!e) { > > - e = __init_nat_entry(nm_i, new, NULL, true); > > + init_dirty = true; > > + e = __init_nat_entry(nm_i, new, NULL, true, true); > > copy_node_info(&e->ni, ni); > > f2fs_bug_on(sbi, ni->blk_addr == NEW_ADDR); > > } else if (new_blkaddr == NEW_ADDR) { > > @@ -498,7 +517,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, > > nat_set_blkaddr(e, new_blkaddr); > > if (!__is_valid_data_blkaddr(new_blkaddr)) > > set_nat_flag(e, IS_CHECKPOINTED, false); > > - __set_nat_cache_dirty(nm_i, e); > > + __set_nat_cache_dirty(nm_i, e, init_dirty); > > > > /* update fsync_mark if its inode nat entry is still alive */ > > if (ni->nid != ni->ino) > > @@ -2924,6 +2943,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) > > struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_HOT_DATA); > > struct f2fs_journal *journal = curseg->journal; > > int i; > > + bool init_dirty; > > > > down_write(&curseg->journal_rwsem); > > for (i = 0; i < nats_in_cursum(journal); i++) { > > @@ -2934,12 +2954,15 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) > > if (f2fs_check_nid_range(sbi, nid)) > > continue; > > > > + init_dirty = false; > > + > > raw_ne = nat_in_journal(journal, i); > > > > ne = __lookup_nat_cache(nm_i, nid, true); > > if (!ne) { > > + init_dirty = true; > > ne = __alloc_nat_entry(sbi, nid, true); > > - __init_nat_entry(nm_i, ne, &raw_ne, true); > > + __init_nat_entry(nm_i, ne, &raw_ne, true, true); > > } > > > > /* > > @@ -2954,7 +2977,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info *sbi) > > spin_unlock(&nm_i->nid_list_lock); > > } > > > > - __set_nat_cache_dirty(nm_i, ne); > > + __set_nat_cache_dirty(nm_i, ne, init_dirty); > > } > > update_nats_in_cursum(journal, -i); > > up_write(&curseg->journal_rwsem); |
From: Zhiguo N. <niu...@gm...> - 2025-07-25 02:08:39
|
Chao Yu via Linux-f2fs-devel <lin...@li...> 于2025年7月25日周五 09:03写道: > > It provides a way to disable linear lookup fallback during mkfs. > > Behavior summary: > Android Distro > By default disabled enabled > Tune w/ [no]hashonly no yes > > Android case: > > 1.1) Disable linear lookup: > mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb > dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 2 : 2] > > 1.2) Enable linear lookup: > mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb > dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 2 : 2] Hi Chao, Seems like a typo here? should be: s_encoding_flags [0x 0 : 0] ? thanks! > > 1.3) By default: > mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb > dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 2 : 2] > > Distro case: > > 2.1) Disable linear lookup: > mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb > dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 2 : 2] > > 2.2) Enable linear lookup: > mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb > dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 0 : 0] > > 2.3) By default: > mkfs.f2fs -f -O casefold -C utf8 /dev/vdb > dump.f2fs -d3 /dev/vdb |grep s_encoding_flags > s_encoding_flags [0x 0 : 0] > > Signed-off-by: Chao Yu <ch...@ke...> > --- > v2: > - disable linear lookup by default for Android case > include/f2fs_fs.h | 3 ++- > lib/libf2fs.c | 1 + > man/mkfs.f2fs.8 | 10 ++++++++-- > mkfs/f2fs_format.c | 3 +++ > mkfs/f2fs_format_main.c | 3 ++- > 5 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > index f7268d1..a8da8fa 100644 > --- a/include/f2fs_fs.h > +++ b/include/f2fs_fs.h > @@ -1478,7 +1478,8 @@ enum { > > /* feature list in Android */ > enum { > - F2FS_FEATURE_NAT_BITS = 0x0001, > + F2FS_FEATURE_NAT_BITS = 0x0001, > + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, > }; > > /* nolinear lookup tune */ > diff --git a/lib/libf2fs.c b/lib/libf2fs.c > index 2f012c8..0e3e62a 100644 > --- a/lib/libf2fs.c > +++ b/lib/libf2fs.c > @@ -1424,6 +1424,7 @@ static const struct enc_flags { > char *param; > } encoding_flags[] = { > { F2FS_ENC_STRICT_MODE_FL, "strict" }, > + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} > }; > > /* Return a positive number < 0xff indicating the encoding magic number > diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 > index 8b3b0cc..8cb7d32 100644 > --- a/man/mkfs.f2fs.8 > +++ b/man/mkfs.f2fs.8 > @@ -232,9 +232,15 @@ Use UTF-8 for casefolding. > .I flags: > .RS 1.2i > .TP 1.2i > -.B strict > +.B [no]strict > This flag specifies that invalid strings should be rejected by the filesystem. > -Default is disabled. > +For android case, it will disable linear lookup by default. > +.RE > +.RS 1.2i > +.TP 1.2i > +.B [no]hashonly > +This flag specifies that there is no linear lookup fallback during lookup. > +By default, linear lookup fallback is enabled. > .RE > .RE > .TP > diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > index 2680bd3..a45bbcb 100644 > --- a/mkfs/f2fs_format.c > +++ b/mkfs/f2fs_format.c > @@ -671,6 +671,9 @@ static int f2fs_prepare_super_block(void) > memcpy(sb->init_version, c.version, VERSION_LEN); > > if (c.feature & F2FS_FEATURE_CASEFOLD) { > + if (!(c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL) && > + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) > + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; > set_sb(s_encoding, c.s_encoding); > set_sb(s_encoding_flags, c.s_encoding_flags); > } > diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c > index f0bec4f..8f8e975 100644 > --- a/mkfs/f2fs_format_main.c > +++ b/mkfs/f2fs_format_main.c > @@ -143,7 +143,8 @@ static void add_default_options(void) > force_overwrite = 1; > c.wanted_sector_size = F2FS_BLKSIZE; > c.root_uid = c.root_gid = 0; > - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; > + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | > + F2FS_FEATURE_LINEAR_LOOKUP; > > /* RO doesn't need any other features */ > if (c.feature & F2FS_FEATURE_RO) > -- > 2.49.0 > > > > _______________________________________________ > Linux-f2fs-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel |
From: hanqi <ha...@vi...> - 2025-07-25 01:45:02
|
在 2025/7/24 21:09, Chao Yu 写道: > On 2025/7/16 16:27, hanqi wrote: >> >> >> 在 2025/7/16 11:43, Jens Axboe 写道: >>> On 7/15/25 9:34 PM, hanqi wrote: >>>> >>>> ? 2025/7/15 22:28, Jens Axboe ??: >>>>> On 7/14/25 9:10 PM, Qi Han wrote: >>>>>> Jens has already completed the development of uncached buffered I/O >>>>>> in git [1], and in f2fs, the feature can be enabled simply by >>>>>> setting >>>>>> the FOP_DONTCACHE flag in f2fs_file_operations. >>>>> You need to ensure that for any DONTCACHE IO that the completion is >>>>> routed via non-irq context, if applicable. I didn't verify that >>>>> this is >>>>> the case for f2fs. Generally you can deduce this as well through >>>>> testing, I'd say the following cases would be interesting to test: >>>>> >>>>> 1) Normal DONTCACHE buffered read >>>>> 2) Overwrite DONTCACHE buffered write >>>>> 3) Append DONTCACHE buffered write >>>>> >>>>> Test those with DEBUG_ATOMIC_SLEEP set in your config, and it that >>>>> doesn't complain, that's a great start. >>>>> >>>>> For the above test cases as well, verify that page cache doesn't >>>>> grow as >>>>> IO is performed. A bit is fine for things like meta data, but >>>>> generally >>>>> you want to see it remain basically flat in terms of page cache >>>>> usage. >>>>> >>>>> Maybe this is all fine, like I said I didn't verify. Just >>>>> mentioning it >>>>> for completeness sake. >>>> Hi, Jens >>>> Thanks for your suggestion. As I mentioned earlier in [1], in f2fs, >>>> the regular buffered write path invokes folio_end_writeback from a >>>> softirq context. Therefore, it seems that f2fs may not be suitable >>>> for DONTCACHE I/O writes. >>>> >>>> I?d like to ask a question: why is DONTCACHE I/O write restricted to >>>> non-interrupt context only? Is it because dropping the page might be >>>> too time-consuming to be done safely in interrupt context? This might >>>> be a naive question, but I?d really appreciate your clarification. >>>> Thanks in advance. >>> Because (as of right now, at least) the code doing the invalidation >>> needs process context. There are various reasons for this, which you'll >>> see if you follow the path off folio_end_writeback() -> >>> filemap_end_dropbehind_write() -> filemap_end_dropbehind() -> >>> folio_unmap_invalidate(). unmap_mapping_folio() is one case, and while >>> that may be doable, the inode i_lock is not IRQ safe. >>> >>> Most file systems have a need to punt some writeback completions to >>> non-irq context, eg for file extending etc. Hence for most file >>> systems, >>> the dontcache case just becomes another case that needs to go through >>> that path. >>> >>> It'd certainly be possible to improve upon this, for example by having >>> an opportunistic dontcache unmap from IRQ/soft-irq context, and then >>> punting to a workqueue if that doesn't pan out. But this doesn't exist >>> as of yet, hence the need for the workqueue punt. > > Thanks Jens for the detailed explanation. > >> >> Hi, Jens >> Thank you for your response. I tested uncached buffer I/O reads with >> a 50GB dataset on a local F2FS filesystem, and the page cache size >> only increased slightly, which I believe aligns with expectations. >> After clearing the page cache, the page cache size returned to its >> initial state. The test results are as follows: >> >> stat 50G.txt >> File: 50G.txt >> Size: 53687091200 Blocks: 104960712 IO Blocks: 512 >> regular file >> >> [read before]: >> echo 3 > /proc/sys/vm/drop_caches >> 01:48:17 kbmemfree kbavail kbmemused %memused >> kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty >> 01:50:59 6404648 8149508 2719384 23.40 512 1898092 >> 199384760 823.75 1846756 466832 44 >> >> ./uncached_io_test 8192 1 1 50G.txt >> Starting 1 threads >> reading bs 8192, uncached 1 >> 1s: 754MB/sec, MB=754 >> ... >> 64s: 844MB/sec, MB=262144 >> >> [read after]: >> 01:52:33 6326664 8121240 2747968 23.65 728 1947656 >> 199384788 823.75 1887896 502004 68 >> echo 3 > /proc/sys/vm/drop_caches >> 01:53:11 6351136 8096936 2772400 23.86 512 1900500 >> 199385216 823.75 1847252 533768 104 >> >> Hi Chao, >> Given that F2FS currently calls folio_end_writeback in the softirq >> context for normal write scenarios, could we first support uncached >> buffer I/O reads? For normal uncached buffer I/O writes, would it be >> feasible for F2FS to introduce an asynchronous workqueue to handle the >> page drop operation in the future? What are your thoughts on this? > > Qi, > > Sorry for the delay. > > I think it will be good to support uncached buffered I/O in read path > first, and then let's take a look what we can do for write path, anyway, > let's do this step by step. > > Can you please update the patch? > - support read path only > - include test data in commit message Chao I will re-submit a patch to first enable F2FS support for uncached buffer I/O reads. Following that, I will work on implementing asynchronous page dropping in F2FS. Thank you! > >> Thank you! >> >> |
From: Chao Yu <ch...@ke...> - 2025-07-25 00:59:40
|
It provides a way to disable linear lookup fallback during mkfs. Behavior summary: Android Distro By default disabled enabled Tune w/ [no]hashonly no yes Android case: 1.1) Disable linear lookup: mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 1.2) Enable linear lookup: mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 1.3) By default: mkfs.f2fs -f -g android -O casefold -C utf8 /dev/vdb dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] Distro case: 2.1) Disable linear lookup: mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] 2.2) Enable linear lookup: mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] 2.3) By default: mkfs.f2fs -f -O casefold -C utf8 /dev/vdb dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 0 : 0] Signed-off-by: Chao Yu <ch...@ke...> --- v2: - disable linear lookup by default for Android case include/f2fs_fs.h | 3 ++- lib/libf2fs.c | 1 + man/mkfs.f2fs.8 | 10 ++++++++-- mkfs/f2fs_format.c | 3 +++ mkfs/f2fs_format_main.c | 3 ++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index f7268d1..a8da8fa 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -1478,7 +1478,8 @@ enum { /* feature list in Android */ enum { - F2FS_FEATURE_NAT_BITS = 0x0001, + F2FS_FEATURE_NAT_BITS = 0x0001, + F2FS_FEATURE_LINEAR_LOOKUP = 0x0002, }; /* nolinear lookup tune */ diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 2f012c8..0e3e62a 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -1424,6 +1424,7 @@ static const struct enc_flags { char *param; } encoding_flags[] = { { F2FS_ENC_STRICT_MODE_FL, "strict" }, + { F2FS_ENC_NO_COMPAT_FALLBACK_FL, "hashonly"} }; /* Return a positive number < 0xff indicating the encoding magic number diff --git a/man/mkfs.f2fs.8 b/man/mkfs.f2fs.8 index 8b3b0cc..8cb7d32 100644 --- a/man/mkfs.f2fs.8 +++ b/man/mkfs.f2fs.8 @@ -232,9 +232,15 @@ Use UTF-8 for casefolding. .I flags: .RS 1.2i .TP 1.2i -.B strict +.B [no]strict This flag specifies that invalid strings should be rejected by the filesystem. -Default is disabled. +For android case, it will disable linear lookup by default. +.RE +.RS 1.2i +.TP 1.2i +.B [no]hashonly +This flag specifies that there is no linear lookup fallback during lookup. +By default, linear lookup fallback is enabled. .RE .RE .TP diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 2680bd3..a45bbcb 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -671,6 +671,9 @@ static int f2fs_prepare_super_block(void) memcpy(sb->init_version, c.version, VERSION_LEN); if (c.feature & F2FS_FEATURE_CASEFOLD) { + if (!(c.s_encoding_flags & F2FS_ENC_NO_COMPAT_FALLBACK_FL) && + (c.disabled_feature & F2FS_FEATURE_LINEAR_LOOKUP)) + c.s_encoding_flags |= F2FS_ENC_NO_COMPAT_FALLBACK_FL; set_sb(s_encoding, c.s_encoding); set_sb(s_encoding_flags, c.s_encoding_flags); } diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index f0bec4f..8f8e975 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -143,7 +143,8 @@ static void add_default_options(void) force_overwrite = 1; c.wanted_sector_size = F2FS_BLKSIZE; c.root_uid = c.root_gid = 0; - c.disabled_feature |= F2FS_FEATURE_NAT_BITS; + c.disabled_feature |= F2FS_FEATURE_NAT_BITS | + F2FS_FEATURE_LINEAR_LOOKUP; /* RO doesn't need any other features */ if (c.feature & F2FS_FEATURE_RO) -- 2.49.0 |
From: Daniel L. <ch...@go...> - 2025-07-24 23:28:50
|
Commit 84447ee7212e correctly relocated the zone alignment check to its proper location. However, this revealed that the original check's condition was incorrect for multi-device setups. This patch corrects the logic to check the alignment relative to the start of the segment0 and improves the error messages. Signed-off-by: Daniel Lee <ch...@go...> --- mkfs/f2fs_format.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index 2680bd3..18f6e34 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -339,17 +339,6 @@ static int f2fs_prepare_super_block(void) MSG(0, "Info: zone aligned segment0 blkaddr: %u\n", get_sb(segment0_blkaddr)); - if (c.zoned_mode && - ((c.ndevs == 1 && - (get_sb(segment0_blkaddr) + c.start_sector / - DEFAULT_SECTORS_PER_BLOCK) % c.zone_blocks) || - (c.ndevs > 1 && - c.devices[1].start_blkaddr % c.zone_blocks))) { - MSG(1, "\tError: Unaligned segment0 block address %u\n", - get_sb(segment0_blkaddr)); - return -1; - } - for (i = 0; i < c.ndevs; i++) { if (i == 0) { c.devices[i].total_segments = @@ -390,6 +379,33 @@ static int f2fs_prepare_super_block(void) c.total_segments += c.devices[i].total_segments; } + + if (c.zoned_mode) { + if (c.ndevs == 1 && + (get_sb(segment0_blkaddr) + c.start_sector / + DEFAULT_SECTORS_PER_BLOCK) % c.zone_blocks) { + /* + * With a sole zoned LU, segment0 start should be + * aligned at the zone. + */ + MSG(1, "\tError: Unaligned segment0 start (%u) for zoned LU (zone_blocks: %lu)\n", + get_sb(segment0_blkaddr), c.zone_blocks); + return -1; + } else if (c.ndevs > 1 && + (c.devices[1].start_blkaddr - get_sb(segment0_blkaddr)) % c.zone_blocks) { + /* + * With the first device as a conventional LU and the + * second as a zoned LU, the start address for the zoned + * LU should be aligned to the zone size, starting from + * segment0. + */ + MSG(1, "\tError: Unaligned start (%lu) for zoned LU from segment0 (%u) (zone_blocks: %lu)\n", + c.devices[1].start_blkaddr, + get_sb(segment0_blkaddr), c.zone_blocks); + return -1; + } + } + set_sb(segment_count, c.total_segments); set_sb(segment_count_ckpt, F2FS_NUMBER_OF_CHECKPOINT_PACK); -- 2.50.1.552.g942d659e1b-goog |
From: <pat...@ke...> - 2025-07-24 20:30:07
|
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <ja...@ke...>: On Thu, 24 Jul 2025 17:31:15 +0200 you wrote: > When testing F2FS with xfstests using UFS backed virtual disks the > kernel complains sometimes that f2fs_release_decomp_mem() calls > vm_unmap_ram() from an invalid context. Example trace from > f2fs/007 test: > > f2fs/007 5s ... [12:59:38][ 8.902525] run fstests f2fs/007 > [ 11.468026] BUG: sleeping function called from invalid context at mm/vmalloc.c:2978 > [ 11.471849] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 68, name: irq/22-ufshcd > [ 11.475357] preempt_count: 1, expected: 0 > [ 11.476970] RCU nest depth: 0, expected: 0 > [ 11.478531] CPU: 0 UID: 0 PID: 68 Comm: irq/22-ufshcd Tainted: G W 6.16.0-rc5-xfstests-ufs-g40f92e79b0aa #9 PREEMPT(none) > [ 11.478535] Tainted: [W]=WARN > [ 11.478536] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 > [ 11.478537] Call Trace: > [ 11.478543] <TASK> > [ 11.478545] dump_stack_lvl+0x4e/0x70 > [ 11.478554] __might_resched.cold+0xaf/0xbe > [ 11.478557] vm_unmap_ram+0x21/0xb0 > [ 11.478560] f2fs_release_decomp_mem+0x59/0x80 > [ 11.478563] f2fs_free_dic+0x18/0x1a0 > [ 11.478565] f2fs_finish_read_bio+0xd7/0x290 > [ 11.478570] blk_update_request+0xec/0x3b0 > [ 11.478574] ? sbitmap_queue_clear+0x3b/0x60 > [ 11.478576] scsi_end_request+0x27/0x1a0 > [ 11.478582] scsi_io_completion+0x40/0x300 > [ 11.478583] ufshcd_mcq_poll_cqe_lock+0xa3/0xe0 > [ 11.478588] ufshcd_sl_intr+0x194/0x1f0 > [ 11.478592] ufshcd_threaded_intr+0x68/0xb0 > [ 11.478594] ? __pfx_irq_thread_fn+0x10/0x10 > [ 11.478599] irq_thread_fn+0x20/0x60 > [ 11.478602] ? __pfx_irq_thread_fn+0x10/0x10 > [ 11.478603] irq_thread+0xb9/0x180 > [ 11.478605] ? __pfx_irq_thread_dtor+0x10/0x10 > [ 11.478607] ? __pfx_irq_thread+0x10/0x10 > [ 11.478609] kthread+0x10a/0x230 > [ 11.478614] ? __pfx_kthread+0x10/0x10 > [ 11.478615] ret_from_fork+0x7e/0xd0 > [ 11.478619] ? __pfx_kthread+0x10/0x10 > [ 11.478621] ret_from_fork_asm+0x1a/0x30 > [ 11.478623] </TASK> > > [...] Here is the summary with links: - [f2fs-dev,v2] f2fs: vm_unmap_ram() may be called from an invalid context https://git.kernel.org/jaegeuk/f2fs/c/08a7efc5b02a You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html |
From: <pat...@ke...> - 2025-07-24 20:30:06
|
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <ja...@ke...>: On Fri, 18 Jul 2025 15:04:31 -0700 you wrote: > From: Daeho Jeong <dae...@go...> > > Otherwise F2FS will not do GC in background in low free section. > > Signed-off-by: Daeho Jeong <dae...@go...> > --- > fs/f2fs/gc.c | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) Here is the summary with links: - [f2fs-dev] f2fs: ignore valid ratio when free section count is low https://git.kernel.org/jaegeuk/f2fs/c/e6d5e789c3b2 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html |
From: <pat...@ke...> - 2025-07-24 20:30:03
|
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <ja...@ke...>: On Wed, 23 Jul 2025 22:58:37 +0800 you wrote: > No functional changes. > > Signed-off-by: mason.zhang <mas...@gm...> > --- > fs/f2fs/gc.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) Here is the summary with links: - [f2fs-dev] f2fs: merge the two conditions to avoid code duplication https://git.kernel.org/jaegeuk/f2fs/c/b93bf64e349b You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html |
From: <pat...@ke...> - 2025-07-24 20:30:00
|
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <ja...@ke...>: On Wed, 23 Jul 2025 22:24:56 +0800 you wrote: > From: Sheng Yong <she...@xi...> > > There is no extra work before trace_f2fs_[dataread|datawrite]_end(), > so there is no need to check trace_<tracepoint>_enabled(). > > Signed-off-by: Sheng Yong <she...@xi...> > > [...] Here is the summary with links: - [f2fs-dev] f2fs: remove unnecessary tracepoint enabled check https://git.kernel.org/jaegeuk/f2fs/c/95d7c508b212 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html |
From: <pat...@ke...> - 2025-07-24 20:30:00
|
Hello: The following patches were marked "accepted", because they were applied to jaegeuk/f2fs.git (dev): Patch: [f2fs-dev] f2fs: remove unnecessary tracepoint enabled check Submitter: Sheng Yong <she...@gm...> Committer: Jaegeuk Kim <ja...@ke...> Patchwork: https://patchwork.kernel.org/project/f2fs/list/?series=985162 Lore link: https://lore.kernel.org/r/202...@xi... Patch: [f2fs-dev] f2fs: don't break allocation when crossing contiguous sections Submitter: Chao Yu <ch...@ke...> Committer: Jaegeuk Kim <ja...@ke...> Patchwork: https://patchwork.kernel.org/project/f2fs/list/?series=984143 Lore link: https://lore.kernel.org/r/202...@ke... Patch: [f2fs-dev] f2fs: merge the two conditions to avoid code duplication Submitter: mason.zhang <mas...@gm...> Committer: Jaegeuk Kim <ja...@ke...> Patchwork: https://patchwork.kernel.org/project/f2fs/list/?series=985175 Lore link: https://lore.kernel.org/r/202...@gm... Patch: [f2fs-dev,v3] f2fs: zone: wait for inflight dio completion, excluding pinned files read using dio Submitter: yohan.joung <yoh...@sk...> Committer: Jaegeuk Kim <ja...@ke...> Patchwork: https://patchwork.kernel.org/project/f2fs/list/?series=984548 Lore link: https://lore.kernel.org/r/202...@sk... Patch: [f2fs-dev] f2fs: ignore valid ratio when free section count is low Submitter: Daeho Jeong <da...@gm...> Committer: Jaegeuk Kim <ja...@ke...> Patchwork: https://patchwork.kernel.org/project/f2fs/list/?series=983893 Lore link: https://lore.kernel.org/r/202...@gm... Patch: [f2fs-dev,v2] f2fs: vm_unmap_ram() may be called from an invalid context Submitter: Jan Prusakowski <jpr...@go...> Committer: Jaegeuk Kim <ja...@ke...> Patchwork: https://patchwork.kernel.org/project/f2fs/list/?series=985638 Lore link: https://lore.kernel.org/r/202...@go... Total patches: 6 -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html |
From: <pat...@ke...> - 2025-07-24 20:29:59
|
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <ja...@ke...>: On Tue, 22 Jul 2025 15:02:40 +0900 you wrote: > read for the pinfile using Direct I/O do not wait for dio write. > > Signed-off-by: yohan.joung <yoh...@sk...> > --- > fs/f2fs/file.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) Here is the summary with links: - [f2fs-dev,v3] f2fs: zone: wait for inflight dio completion, excluding pinned files read using dio https://git.kernel.org/jaegeuk/f2fs/c/3bf1bab503a5 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html |
From: <pat...@ke...> - 2025-07-24 20:29:57
|
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <ja...@ke...>: On Mon, 21 Jul 2025 10:02:31 +0800 you wrote: > Commit 0638a3197c19 ("f2fs: avoid unused block when dio write in LFS > mode") has fixed unused block issue for dio write in lfs mode. > > However, f2fs_map_blocks() may break and return smaller extent when > last allocated block locates in the end of section, even allocator > can allocate contiguous blocks across sections. > > [...] Here is the summary with links: - [f2fs-dev] f2fs: don't break allocation when crossing contiguous sections https://git.kernel.org/jaegeuk/f2fs/c/f0a7adfedcc8 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html |