Re: [f2fs-dev] [PATCH] f2fs: remove unused sbi argument from checksum functions

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
On 5/13/25 13:48, Eric Biggers via Linux-f2fs-devel wrote: > From: Eric Biggers > > Since __f2fs_crc32() now calls crc32() directly, it no longer uses its > sbi argument. Remove that, and simplify its callers accordingly. > > Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Thanks, __

Re: [f2fs-dev] [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{, de}compress_ctx

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
On 5/13/25 14:01, Christoph Hellwig wrote: > On Tue, May 13, 2025 at 01:57:20PM +0800, Chao Yu wrote: >> .init_{,de}compress_ctx uses kvmalloc() to alloc memory, it will try >> to allocate physically continuous page first, it may cause more memory >> allocation pressure, let's use vmalloc instead t

Re: [f2fs-dev] [PATCH v3] f2fs/013: test to check potential corruption on atomic_write file

2025-05-12 Thread Zorro Lang via Linux-f2fs-devel
On Fri, May 09, 2025 at 02:07:54PM +0800, Chao Yu wrote: > This is a regression testcase to check whether we will handle database > inode dirty status correctly: > 1. mount f2fs image w/ timeout fault injection option > 2. create a regular file, and write data into the file > 3. start transaction o

[f2fs-dev] [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{, de}compress_ctx

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
.init_{,de}compress_ctx uses kvmalloc() to alloc memory, it will try to allocate physically continuous page first, it may cause more memory allocation pressure, let's use vmalloc instead to mitigate it. [Test] cd /data/local/tmp touch file f2fs_io setflags compression file f2fs_io getflags file fo

Re: [f2fs-dev] [PATCH 1/2] f2fs: use vmalloc instead of kvmalloc in .init_{, de}compress_ctx

2025-05-12 Thread Christoph Hellwig
On Tue, May 13, 2025 at 01:57:20PM +0800, Chao Yu wrote: > .init_{,de}compress_ctx uses kvmalloc() to alloc memory, it will try > to allocate physically continuous page first, it may cause more memory > allocation pressure, let's use vmalloc instead to mitigate it. Shouldn't this be handled in kvm

[f2fs-dev] [PATCH 2/2] f2fs: introduce FAULT_VMALLOC

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
Introduce a new fault type FAULT_VMALLOC to simulate no memory error in f2fs_vmalloc(). Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 1 + Documentation/filesystems/f2fs.rst | 1 + fs/f2fs/compress.c | 9 + fs/f2fs/f2fs.h

[f2fs-dev] [PATCH] f2fs: remove unused sbi argument from checksum functions

2025-05-12 Thread Eric Biggers via Linux-f2fs-devel
From: Eric Biggers Since __f2fs_crc32() now calls crc32() directly, it no longer uses its sbi argument. Remove that, and simplify its callers accordingly. Signed-off-by: Eric Biggers --- fs/f2fs/checkpoint.c | 13 ++--- fs/f2fs/compress.c | 5 ++--- fs/f2fs/f2fs.h | 20 ++

Re: [f2fs-dev] [PATCH v3] f2fs/013: test to check potential corruption on atomic_write file

2025-05-12 Thread David Disseldorp
On Fri, 9 May 2025 14:07:54 +0800, Chao Yu wrote: > This is a regression testcase to check whether we will handle database > inode dirty status correctly: > 1. mount f2fs image w/ timeout fault injection option > 2. create a regular file, and write data into the file > 3. start transaction on the

[f2fs-dev] [PATCH v2 2/2] f2fs: add f2fs_bug_on() in f2fs_quota_read()

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
mapping_read_folio_gfp() will return a folio, it should always be uptodate, let's check folio uptodate status to detect any potenial bug. Signed-off-by: Chao Yu --- v2: - just add f2fs_bug_on(), get rid of error handling. fs/f2fs/super.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/

Re: [f2fs-dev] [PATCH V3 7/7] f2fs: switch to the new mount api

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
On 5/13/25 10:19, Eric Sandeen wrote: > On 5/11/25 10:43 PM, Chao Yu wrote: >> On 5/8/25 23:59, Eric Sandeen wrote: >>> On 5/8/25 4:19 AM, Chao Yu wrote: > @@ -2645,21 +2603,11 @@ static int f2fs_remount(struct > super_block *sb, int *flags, char *data) > > default_options(sbi, true

Re: [f2fs-dev] [PATCH 2/2] f2fs: add f2fs_bug_on() in f2fs_quota_read()

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
On 5/12/25 23:27, Jaegeuk Kim wrote: > On 05/12, Chao Yu wrote: >> mapping_read_folio_gfp() will return a folio, it should always be >> uptodate, let's check folio uptodate status to detect any potenial >> bug. > > If it's supposed to be uptodate, can you add f2fs_bug_on() only? Sure. Thanks, >

Re: [f2fs-dev] [PATCH 1/2] f2fs: add f2fs_bug_on() to detect potential bug

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
On 5/12/25 23:26, Jaegeuk Kim wrote: > On 05/12, Chao Yu wrote: >> Add f2fs_bug_on() to check whether memory preallocation will fail or >> not after radix_tree_preload(GFP_NOFS | __GFP_NOFAIL). > > Are we getting a bug? No, I'm worried about potential issue from add_free_nid() can cause node foot

Re: [f2fs-dev] [PATCH V3 7/7] f2fs: switch to the new mount api

2025-05-12 Thread Eric Sandeen via Linux-f2fs-devel
On 5/11/25 10:43 PM, Chao Yu wrote: > On 5/8/25 23:59, Eric Sandeen wrote: >> On 5/8/25 4:19 AM, Chao Yu wrote: @@ -2645,21 +2603,11 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) default_options(sbi, true); - memset(&fc, 0, sizeof(fc));

Re: [f2fs-dev] [PATCH V3 5/7] f2fs: separate the options parsing and options checking

2025-05-12 Thread Jaegeuk Kim via Linux-f2fs-devel
On 04/23, Eric Sandeen wrote: > From: Hongbo Li > > The new mount api separates option parsing and super block setup > into two distinct steps and so we need to separate the options > parsing out of the parse_options(). > > In order to achieve this, here we handle the mount options with > three

Re: [f2fs-dev] [PATCH 2/2] f2fs: add f2fs_bug_on() in f2fs_quota_read()

2025-05-12 Thread Jaegeuk Kim via Linux-f2fs-devel
On 05/12, Chao Yu wrote: > mapping_read_folio_gfp() will return a folio, it should always be > uptodate, let's check folio uptodate status to detect any potenial > bug. If it's supposed to be uptodate, can you add f2fs_bug_on() only? > > Signed-off-by: Chao Yu > --- > fs/f2fs/super.c | 11

Re: [f2fs-dev] [PATCH 1/2] f2fs: add f2fs_bug_on() to detect potential bug

2025-05-12 Thread Jaegeuk Kim via Linux-f2fs-devel
On 05/12, Chao Yu wrote: > Add f2fs_bug_on() to check whether memory preallocation will fail or > not after radix_tree_preload(GFP_NOFS | __GFP_NOFAIL). Are we getting a bug? > > Signed-off-by: Chao Yu > --- > fs/f2fs/checkpoint.c | 4 +++- > fs/f2fs/node.c | 7 +-- > 2 files changed

[f2fs-dev] [PATCH 1/2] f2fs: add f2fs_bug_on() to detect potential bug

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
Add f2fs_bug_on() to check whether memory preallocation will fail or not after radix_tree_preload(GFP_NOFS | __GFP_NOFAIL). Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 4 +++- fs/f2fs/node.c | 7 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/checkpoin

[f2fs-dev] [PATCH] f2fs: fix 32-bits hexademical number in fault injection doc

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
FAULT_KMALLOC0x1 There is one redundant '0' in 32-bits hexademical number of fault type, remove it. Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 52 - Documentation/filesystems/f2fs.rst | 52 ---

[f2fs-dev] [PATCH 2/2] f2fs: add f2fs_bug_on() in f2fs_quota_read()

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
mapping_read_folio_gfp() will return a folio, it should always be uptodate, let's check folio uptodate status to detect any potenial bug. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 0ee7832249

Re: [f2fs-dev] [PATCH v5 1/2] f2fs: add a method for calculating the remaining blocks in the current segment in LFS mode.

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
On 5/12/25 15:36, yohan.joung wrote: > In LFS mode, the previous segment cannot use invalid blocks, > so the remaining blocks from the next_blkoff of the current segment > to the end of the section are calculated. > > Signed-off-by: yohan.joung Reviewed-by: Chao Yu Thanks, __

Re: [f2fs-dev] [PATCH v5 2/2] f2fs: add ckpt_valid_blocks to the section entry

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
On 5/12/25 15:36, yohan.joung wrote: > when performing buffered writes in a large section, > overhead is incurred due to the iteration through > ckpt_valid_blocks within the section. > when SEGS_PER_SEC is 128, this overhead accounts for 20% within > the f2fs_write_single_data_page routine. > as th

[f2fs-dev] [PATCH v5 1/2] f2fs: add a method for calculating the remaining blocks in the current segment in LFS mode.

2025-05-12 Thread yohan.joung
In LFS mode, the previous segment cannot use invalid blocks, so the remaining blocks from the next_blkoff of the current segment to the end of the section are calculated. Signed-off-by: yohan.joung --- fs/f2fs/segment.h | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(

[f2fs-dev] [PATCH v5 2/2] f2fs: add ckpt_valid_blocks to the section entry

2025-05-12 Thread yohan.joung
when performing buffered writes in a large section, overhead is incurred due to the iteration through ckpt_valid_blocks within the section. when SEGS_PER_SEC is 128, this overhead accounts for 20% within the f2fs_write_single_data_page routine. as the size of the section increases, the overhead als

[f2fs-dev] [PATCH] libf2fs: print block size

2025-05-12 Thread Chao Yu via Linux-f2fs-devel
nl6720 reported in [1], mkfs.f2fs doesn't report block size, instead, it prints sector size which is not used inside f2fs. Let's print block size as well during mkfs as below: output of mkfs.f2fs: Info: sector size = 512 Info: total sectors = 16777216 (8192 MB) Info: block size = 4096 [1] https