[f2fs-dev] [PATCH] f2fs: compress: reserve blocks on released compress inode while writing

2024-01-10 Thread Yangtao Li via Linux-f2fs-devel
Reserve blocks on released compress inode while writing, so compressed files with released space are allowed to be rewritten. Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 86 ++ 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/fs/f

[f2fs-dev] [PATCH] f2fs: compress: do cleanup in f2fs_truncate_partial_cluster()

2023-11-30 Thread Yangtao Li via Linux-f2fs-devel
Remove unnecessary code logic. Signed-off-by: Yangtao Li --- fs/f2fs/compress.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 36e5dab6baae..de55c266509a 100644 --- a/fs/f2fs/compress.c +++ b/fs/f

[f2fs-dev] [PATCH v2] f2fs: add support for an i_version counter

2023-11-30 Thread Yangtao Li via Linux-f2fs-devel
NFSv4 mandates a change attribute to avoid problems with timestamp granularity, which Linux implements using the i_version counter. This is particularly important when the underlying filesystem is fast. BTW introduce a new mount option to enable the iversion functionality, and disabling it by defa

[f2fs-dev] [PATCH] f2fs: add support for an i_version counter

2023-11-20 Thread Yangtao Li via Linux-f2fs-devel
NFSv4 mandates a change attribute to avoid problems with timestamp granularity, which Linux implements using the i_version counter. This is particularly important when the underlying filesystem is fast. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h | 1 + fs/f2fs/inode.c | 1 + fs/f2fs/super.c |

Re: [f2fs-dev] f2fs async buffered write patch

2023-06-26 Thread Yangtao Li via Linux-f2fs-devel
+cc wi...@infradead.org On 2023/6/20 4:43, Jens Axboe wrote: Hi, I came across this patch in a news posting: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=d618126911829523e35a61f4a5a4ad159b1b2c8d which has me a bit worried. As far as I can tell, all that

[f2fs-dev] [PATCH v2] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-20 Thread Yangtao Li via Linux-f2fs-devel
It is observed that when in user compression mode (compress_extension=*), even though the file is not compressed, the file is still forced to use buffer io, which makes the AndroBench sequential read and write drop significantly. In fact, when the file is not compressed, we don't need to force it t

Re: [f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-19 Thread Yangtao Li via Linux-f2fs-devel
On 2023/6/19 12:04, Chao Yu wrote: On 2023/6/19 11:11, Yangtao Li wrote: On 2023/6/19 8:54, Chao Yu wrote: On 2023/6/13 12:14, Yangtao Li wrote: On 2023/6/12 22:38, Chao Yu wrote: On 2023/6/9 21:15, Yangtao Li wrote: It is observed that when in user compression mode (compress_extension=*)

[f2fs-dev] [PATCH] f2fs: call fsnotify_sb_error() when f2fs have errors

2023-06-19 Thread Yangtao Li via Linux-f2fs-devel
When an EFSCORRUPTED error occurs in f2fs, report the error to userspace monitoring tools. Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 375a178540d6..69c747c4d4f4 100644 --- a/fs/f2fs/super.c +++ b/

Re: [f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-18 Thread Yangtao Li via Linux-f2fs-devel
On 2023/6/19 8:54, Chao Yu wrote: On 2023/6/13 12:14, Yangtao Li wrote: On 2023/6/12 22:38, Chao Yu wrote: On 2023/6/9 21:15, Yangtao Li wrote: It is observed that when in user compression mode (compress_extension=*), even though the file is not compressed, the file is still forced to use

Re: [f2fs-dev] [PATCH v6] f2fs: support FAULT_LOCK type fault injection

2023-06-13 Thread Yangtao Li via Linux-f2fs-devel
ping.. ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: no need test opt for f2fs_issue_flush

2023-06-13 Thread Yangtao Li via Linux-f2fs-devel
ping... ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

[f2fs-dev] [PATCH 2/2] f2fs: convert to use sbi directly

2023-06-13 Thread Yangtao Li via Linux-f2fs-devel
F2FS_I_SB(inode) is redundant. Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 41e7c2b80f31..f45d05c13ae5 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3476,7 +3476,7 @@ sta

[f2fs-dev] [PATCH 1/2] f2fs: convert to use F2FS_SMALL_VOLUME_IPU_POLICY macro

2023-06-13 Thread Yangtao Li via Linux-f2fs-devel
Just for cleanup. Signed-off-by: Yangtao Li --- fs/f2fs/segment.h | 2 ++ fs/f2fs/super.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 2ca8fb5d0dc4..28ccbaffe546 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -70

Re: [f2fs-dev] [PATCH v4] f2fs: refactor struct f2fs_attr macro

2023-06-13 Thread Yangtao Li via Linux-f2fs-devel
ping.. ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

[f2fs-dev] [PATCH v2] f2fs: enable nowait async buffered writes

2023-06-13 Thread Yangtao Li via Linux-f2fs-devel
This adds the async buffered write support to f2fs, the following is the relevant test data. iodepth | 1| 2| 4| 8| 16 | before(M/s) | 1012 | 1133 | 894 | 981 | 866 | after(M/s) | 1488 | 1896 | 2081 | 2188 | 2207 | The following is the fio configuration: [global] ioen

[f2fs-dev] [PATCH v3] f2fs_io: expend fallocate command

2023-06-13 Thread Yangtao Li via Linux-f2fs-devel
Expend fallocate command to support more flags. Signed-off-by: Yangtao Li --- v3: -update man/f2fs_io.8 man/f2fs_io.8 | 19 ++- tools/f2fs_io/f2fs_io.c | 39 +-- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/man/f2fs

Re: [f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-12 Thread Yangtao Li via Linux-f2fs-devel
On 2023/6/12 22:38, Chao Yu wrote: On 2023/6/9 21:15, Yangtao Li wrote: It is observed that when in user compression mode (compress_extension=*), even though the file is not compressed, the file is still forced to use buffer io, which makes the AndroBench sequential read and write drop signifi

[f2fs-dev] [PATCH] f2fs: compress: don't force buffered io when in COMPR_MODE_USER mode

2023-06-09 Thread Yangtao Li via Linux-f2fs-devel
It is observed that when in user compression mode (compress_extension=*), even though the file is not compressed, the file is still forced to use buffer io, which makes the AndroBench sequential read and write drop significantly. In fact, when the file is not compressed, we don't need to force it t

[f2fs-dev] [PATCH v2] f2fs_io: expend fallocate command

2023-06-07 Thread Yangtao Li via Linux-f2fs-devel
Expend fallocate command to support more flags. Signed-off-by: Yangtao Li --- tools/f2fs_io/f2fs_io.c | 39 +-- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index 1774eca..5a6a6a0 100644 --- a

Re: [f2fs-dev] [PATCH] f2fs: enable nowait async buffered writes

2023-06-06 Thread Yangtao Li via Linux-f2fs-devel
On 2023/6/6 14:43, Chao Yu wrote: On 2023/5/31 22:40, Yangtao Li wrote: This adds the async buffered write support to f2fs, the following is the relevant test data. Yangtao, Could you please provide detailed test command? Use fio to test, the following is the configuration: # io_uring [g

[f2fs-dev] [PATCH] f2fs: enable nowait async buffered writes

2023-05-31 Thread Yangtao Li via Linux-f2fs-devel
This adds the async buffered write support to f2fs, the following is the relevant test data. iodepth | 1| 2| 4| 8| 16 | before(M/s) | 1012 | 1133 | 894 | 981 | 866 | after(M/s) | 1488 | 1896 | 2081 | 2188 | 2207 | Signed-off-by: Lu Hongfei Signed-off-by: Yangtao Li

[f2fs-dev] [PATCH] f2fs: flag as supporting buffered async reads

2023-05-31 Thread Yangtao Li via Linux-f2fs-devel
After enabling this feature, the read performance has been greatly improved: 167M/s -> 234M/s, Increase ratio by 40% Test w/: ./fio --name=onessd --filename=/data/test/local/io_uring_test --size=256M --rw=randread --bs=4k --direct=0 --overwrite=0 --numjobs=1 --iodepth=1 --time_bas

[f2fs-dev] [PATCH] f2fs: add fsnotify_sb_error() in f2fs_save_errors

2023-05-11 Thread Yangtao Li via Linux-f2fs-devel
When an EFSCORRUPTED error occurs in f2fs, report the error to userspace monitoring tools. Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 51812f459581..42d5aa504afe 100644 --- a/fs/f2fs/super.c +++ b/fs

[f2fs-dev] [PATCH 3/4] f2fs: move the conditional statement to hold the inode lock in f2fs_release_compress_blocks()

2023-05-09 Thread Yangtao Li via Linux-f2fs-devel
For judging the inode flag state, the inode lock must be held. Fixes: ef8d563f184e ("f2fs: introduce F2FS_IOC_RELEASE_COMPRESS_BLOCKS") Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index a

[f2fs-dev] [PATCH 4/4] f2fs: move the conditional statement to hold the inode lock in f2fs_reserve_compress_blocks()

2023-05-09 Thread Yangtao Li via Linux-f2fs-devel
For judging the inode flag state, the inode lock must be held. Fixes: c75488fb4d82 ("f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS") Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 3

[f2fs-dev] [PATCH 1/4] f2fs: convert to use sbi directly

2023-05-09 Thread Yangtao Li via Linux-f2fs-devel
F2FS_I_SB(inode) is redundant. Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 0dbbcb406d3f..6f8936ec689c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3466,7 +3466,7 @@ sta

[f2fs-dev] [PATCH 2/4] f2fs: move the conditional statement to hold the inode lock in f2fs_ioc_decompress_file() and f2fs_ioc_compress_file()

2023-05-09 Thread Yangtao Li via Linux-f2fs-devel
For judging the inode flag state, the inode lock must be held. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/file.c

Re: [f2fs-dev] [PATCH v3] f2fs: add sanity compress level check for compressed file

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
ping.. > On 2023/4/8 2:31, Yangtao Li wrote: ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

[f2fs-dev] [PATCH v4] f2fs: refactor struct f2fs_attr macro

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
This patch provides a large number of variants of F2FS_RW_ATTR and F2FS_RO_ATTR macros, reducing the number of parameters required to initialize the f2fs_attr structure. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304152234.wjay3iym-...@intel.com/ Signed-off-by:

[f2fs-dev] [PATCH v2 2/2] f2fs: move the conditional statement after holding the inode lock in f2fs_fallocate()

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
For judging the inode flag state, the inode lock must be held. Cc: Christophe JAILLET Fixes: fcc85a4d86b5 ("f2fs crypto: activate encryption support for fs APIs") Signed-off-by: Yangtao Li --- v2: -add unlock fs/f2fs/file.c | 22 +- 1 file changed, 13 insertions(+), 9 deleti

[f2fs-dev] [PATCH v2 1/2] f2fs: move the conditional statement after holding the inode lock in f2fs_move_file_range()

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
For judging the inode flag state, the inode lock must be held. BTW, add compressd file check and to avoid 'if' nesting. Cc: Christophe JAILLET Fixes: 4dd6f977fc77 ("f2fs: support an ioctl to move a range of data blocks") Signed-off-by: Yangtao Li --- v2: -add unlock fs/f2fs/file.c | 18

[f2fs-dev] [PATCH] f2fs_io: expend fallocate command

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
Expend fallocate command to support more flags. Signed-off-by: Yangtao Li --- tools/f2fs_io/f2fs_io.c | 37 - 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index 126e1f9..1be8c9e 100644 --- a/t

[f2fs-dev] [PATCH v2] f2fs_io: support move_range command

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
This patch supports a new sub-command 'move_range' in f2fs_io to move a range of data blocks from source file to destination file via F2FS_IOC_MOVE_RANGE ioctl. Signed-off-by: Yangtao Li --- man/f2fs_io.8 | 4 tools/f2fs_io/f2fs_io.c | 36 2 f

[f2fs-dev] [PATCH 2/2] f2fs: move the conditional statement after holding the inode lock in f2fs_fallocate()

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
For judging the inode flag state, the inode lock must be held. Fixes: fcc85a4d86b5 ("f2fs crypto: activate encryption support for fs APIs") Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/fil

[f2fs-dev] [PATCH 1/2] f2fs: move the conditional statement after holding the inode lock in f2fs_move_file_range()

2023-05-06 Thread Yangtao Li via Linux-f2fs-devel
For judging the inode flag state, the inode lock must be held. BTW, add compressd file check and to avoid 'if' nesting. Fixes: 4dd6f977fc77 ("f2fs: support an ioctl to move a range of data blocks") Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 14 -- 1 file changed, 8 insertions(+),

[f2fs-dev] [PATCH] f2fs: fix to call invalidate_mapping_pages in f2fs_move_file_range

2023-05-04 Thread Yangtao Li via Linux-f2fs-devel
In the following scenario, after executing the move_range ioctl syscall, the block size of the source file is 0, but data can still be read. # stat test File: test Size: 6 Blocks: 8 IO Block: 4096 regular file # ./new_f2fs_io move_range test test_move_range 0 0 0

[f2fs-dev] [PATCH] f2fs_io: support move_range command

2023-05-04 Thread Yangtao Li via Linux-f2fs-devel
This patch supports a new sub-command 'move_range' in f2fs_io to move a range of data blocks from source file to destination file via F2FS_IOC_MOVE_RANGE ioctl. Signed-off-by: Yangtao Li --- man/f2fs_io.8 | 4 tools/f2fs_io/f2fs_io.c | 35 +++ 2 fi

[f2fs-dev] [PATCH] f2fs: simplify the processing logic of retry_cnt

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
Replace if (a > 0) { a--; } with: if (a-- > 0) { } Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 107585797ffa..cbab0cc2c82e 100644 --- a/fs/f2fs/super.c +++ b

[f2fs-dev] [PATCH] f2fs: introduce mount_errors related api

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
This patch introduces mount_errors related api and uses it in code. Signed-off-by: Yangtao Li --- fs/f2fs/data.c | 2 +- fs/f2fs/f2fs.h | 15 +++ fs/f2fs/node.c | 2 +- fs/f2fs/super.c | 11 +-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/data

[f2fs-dev] [PATCH] f2fs: introduce bggc_mode related api

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
This patch introduces bggc_mode related api and uses it in code. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h | 15 +++ fs/f2fs/gc.c| 2 +- fs/f2fs/super.c | 13 ++--- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index

[f2fs-dev] [PATCH] f2fs: no need test opt for f2fs_issue_flush

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
This information can now be obtained from the mount, and there isi no need to print it out every time the trace event is triggered. Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 3 +-- include/trace/events/f2fs.h | 13 +++-- 2 files changed, 4 insertions(+), 12 deletions(-

[f2fs-dev] [PATCH v2] f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
If a file has FI_COMPRESS_RELEASED, all writes for it should not be allowed. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Signed-off-by: Qi Han Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs

[f2fs-dev] [PATCH v3] f2fs: refactor struct f2fs_attr macro

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
This patch provides a large number of variants of F2FS_RW_ATTR and F2FS_RO_ATTR macros, reducing the number of parameters required to initialize the f2fs_attr structure. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304152234.wjay3iym-...@intel.com/ Signed-off-by:

[f2fs-dev] [PATCH v2] f2fs: add sanity check for proc_mkdir

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
Return -ENOMEM when proc_mkdir failed. Signed-off-by: Yangtao Li --- v2: -removing check for proc in f2fs_unregister_sysfs and f2fs_register_sysfs fs/f2fs/sysfs.c | 39 +++ 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2

[f2fs-dev] [PATCH] f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED

2023-04-25 Thread Yangtao Li via Linux-f2fs-devel
If a file has FI_COMPRESS_RELEASED, all writes for it should not be allowed. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Signed-off-by: Qi Han Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/f

[f2fs-dev] [PATCH] f2fs: introduce discard_urgent_percent node

2023-04-21 Thread Yangtao Li via Linux-f2fs-devel
There will be IO performance degradation in the following scenarios: -The space utilization rate remains below 80%(e.g. 79%) -There are many big discard commands generated -Always have read and write IO generated The performance degradation is due to a large number of undiscard blocks while

[f2fs-dev] [PATCH] f2fs: make __issue_discard_cmd() return more appropriate error code

2023-04-21 Thread Yangtao Li via Linux-f2fs-devel
Returns -EBUSY when __issue_discard() is interrupted by io, instead of returning -1. Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6db410f1bb8c..a005948dca93 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH v6] f2fs: support FAULT_LOCK type fault injection

2023-04-19 Thread Yangtao Li via Linux-f2fs-devel
Similar to FAULT_LOCK_OP, this patch supports to inject fault into variant of _trylock(), including: - inode_trylock - down_read_trylock - down_write_trylock - mutex_trylock - sb_start_write_trylock - trylock_page Usage: a) echo 524288 > /sys/fs/f2fs//inject_type or b) mount -o fau

Re: [f2fs-dev] [PATCH v4 1/2] f2fs: refactor struct iostat_lat_info

2023-04-19 Thread Yangtao Li via Linux-f2fs-devel
> > + ctx = iostat_get_bio_private(bio); > > This ctx is not used for iostat. Considering that the next patch needs to store the discard_cmd pointer in bio_iostat_ctx, there is no need to add a new variable. We just need to rename post_read_ctx to data. Change bio_iostat_ctx->post_read_c

[f2fs-dev] [PATCH] f2fs: add a tracepoint for discard thread

2023-04-19 Thread Yangtao Li via Linux-f2fs-devel
This patch introduces a tracepoint to monitor discard thread behaviors. Signed-off-by: Yangtao Li --- fs/f2fs/segment.c | 3 +++ include/trace/events/f2fs.h | 28 2 files changed, 31 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6

[f2fs-dev] [PATCH] f2fs: fix typo

2023-04-18 Thread Yangtao Li via Linux-f2fs-devel
Add missing 'is'. Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 9f15b03037db..357d45e49635 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1362,7 +1362,7 @@ static int parse_opt

[f2fs-dev] [PATCH] docs: f2fs: update noinline_data mount opt description

2023-04-18 Thread Yangtao Li via Linux-f2fs-devel
Slightly modify the description of noinline_data and move it near the description of inline_data. Cc: Bagas Sanjaya Suggested-by: Bagas Sanjaya Signed-off-by: Yangtao Li --- Documentation/filesystems/f2fs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation

[f2fs-dev] [PATCH v3] docs: f2fs: specify extent cache for read explicitly

2023-04-18 Thread Yangtao Li via Linux-f2fs-devel
Clarify the fact that extent_cache and noextent_cache toggle read extent cache on or off. Cc: Bagas Sanjaya Signed-off-by: Yangtao Li --- v3: -update msg Documentation/filesystems/f2fs.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/f2fs.r

[f2fs-dev] [PATCH v2] docs: f2fs: specify extent cache for read explicitly

2023-04-16 Thread Yangtao Li via Linux-f2fs-devel
Let's descrbie it's read extent cache. Signed-off-by: Yangtao Li --- v2: -s/an/a Documentation/filesystems/f2fs.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst index c57745375edb..84911b7aff25

[f2fs-dev] [PATCH] docs: f2fs: specify extent cache for read explicitly

2023-04-16 Thread Yangtao Li via Linux-f2fs-devel
Let's descrbie it's read extent cache. Signed-off-by: Yangtao Li --- Documentation/filesystems/f2fs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst index c57745375edb..f68337086dec 100644 --- a/D

[f2fs-dev] [PATCH v2] f2fs: refactor struct f2fs_attr macro

2023-04-15 Thread Yangtao Li via Linux-f2fs-devel
This patch provides a large number of variants of F2FS_RW_ATTR and F2FS_RO_ATTR macros, reducing the number of parameters required to initialize the f2fs_attr structure. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304152234.wjay3iym-...@intel.com/ Signed-off-by:

[f2fs-dev] [PATCH] f2fs: refactor struct f2fs_attr macro

2023-04-15 Thread Yangtao Li via Linux-f2fs-devel
This patch provides a large number of variants of F2FS_RW_ATTR and F2FS_RO_ATTR macros, reducing the number of parameters required to initialize the f2fs_attr structure. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 237 +--- 1 file changed, 146 inse

[f2fs-dev] [PATCH v2] f2fs_io: support precache_extents command

2023-04-14 Thread Yangtao Li via Linux-f2fs-devel
This patch supports a new sub-command 'precache_extents' in f2fs_io to trigger precache extents via F2FS_IOC_PRECACHE_EXTENTS ioctl. Signed-off-by: Yangtao Li --- v2: -fix precache_extents_help man/f2fs_io.8 | 3 +++ tools/f2fs_io/f2fs_io.c | 24 2 files chang

[f2fs-dev] [PATCH] f2fs_io: support precache_extents command

2023-04-14 Thread Yangtao Li via Linux-f2fs-devel
This patch supports a new sub-command 'precache_extents' in f2fs_io to trigger precache extents via F2FS_IOC_PRECACHE_EXTENTS ioctl. Signed-off-by: Yangtao Li --- man/f2fs_io.8 | 3 +++ tools/f2fs_io/f2fs_io.c | 24 2 files changed, 27 insertions(+) diff --gi

[f2fs-dev] [PATCH] f2fs: add has_enough_free_secs()

2023-04-13 Thread Yangtao Li via Linux-f2fs-devel
Replace !has_not_enough_free_secs w/ has_enough_free_secs. BTW avoid nested 'if' statements in f2fs_balance_fs(). Signed-off-by: Yangtao Li --- fs/f2fs/gc.c | 2 +- fs/f2fs/segment.c | 43 ++- fs/f2fs/segment.h | 8 +++- 3 files changed, 30 inse

Re: [f2fs-dev] [PATCH] f2fs: export gc_mode in debugfs

2023-04-13 Thread Yangtao Li via Linux-f2fs-devel
> What if some app/script is using gc_modeit breaks its use. Similar words, you said before. https://lore.kernel.org/lkml/cd6d15e3-b692-d3c1-0f01-33e632f5f...@kernel.org/ The instructions for these nodes are in the Documentation/ABI/testing/ directory, not the Documentation/ABI/stable direc

Re: [f2fs-dev] [PATCH] f2fs: introduce F2FS_SBI_RW_ATTR macro

2023-04-13 Thread Yangtao Li via Linux-f2fs-devel
> F2FS_RW_ATTR looks more common to me. My idea is to add macro like this: F2FS_SBI_GENERAL_RW_ATTR(node_io_flag); CPRC_INFO_GENERAL_RW_ATTR(ckpt_thread_ioprio); .. F2FS_SBI_RW_ATTR(umount_discard_timeout, interval_time[UMOUNT_DISCARD_TIMEOUT]); It seems unnecessary to repeat a bunch of the

[f2fs-dev] [PATCH] f2fs: export gc_mode in debugfs

2023-04-12 Thread Yangtao Li via Linux-f2fs-devel
This patch exports gc_mode to debugfs. Since gc_urgent and gc_idle nodes can get gc mode, so remove gc_mode node. Signed-off-by: Yangtao Li --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 -- fs/f2fs/debug.c | 13 - fs/f2fs/sysfs.c

[f2fs-dev] [PATCH] f2fs: introduce F2FS_SBI_RW_ATTR macro

2023-04-11 Thread Yangtao Li via Linux-f2fs-devel
For the readable and writable f2fs_attr with struct_type of F2FS_SBI type, let's directly use the F2FS_SBI_RW_ATTR macro. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 73 + 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/fs/f2fs/

[f2fs-dev] [PATCH v3] f2fs: add sanity compress level check for compressed file

2023-04-07 Thread Yangtao Li via Linux-f2fs-devel
Commit 3fde13f817e2 ("f2fs: compress: support compress level") forgot to do basic compress level check, let's add it. Signed-off-by: Yangtao Li --- fs/f2fs/inode.c | 106 +++- 1 file changed, 77 insertions(+), 29 deletions(-) diff --git a/fs/f2fs/inod

[f2fs-dev] [PATCH v4 1/2] f2fs: refactor struct iostat_lat_info

2023-04-07 Thread Yangtao Li via Linux-f2fs-devel
The current code uses a mixture of MAX_IO_TYPE and NR_PAGE_TYPE to form lat_type, and uses a two-dimensional array to store data. NR_PAGE_TYPE is 3, which is unreasonable for a discard with a PAGE_TYPE of 1. So this patch changes the array to a 1D array and does some cleanup. Signed-off-by: Yangta

[f2fs-dev] [PATCH v4 2/2] f2fs: add iostat latency statistics support for discard

2023-04-07 Thread Yangtao Li via Linux-f2fs-devel
In this patch, it adds to account discard latency. This allows us to track the discard io latency of the system lightweightly after enabling iostat. Signed-off-by: Yangtao Li --- v4: -split it to two patch fs/f2fs/f2fs.h | 1 + fs/f2fs/iostat.c| 6 -- fs/f2fs/segme

[f2fs-dev] [PATCH] f2fs: add sanity check for proc_mkdir

2023-04-06 Thread Yangtao Li via Linux-f2fs-devel
Return -ENOMEM when proc_mkdir failed. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 3aad3500a701..dcd497e0920a 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -13

[f2fs-dev] [PATCH] f2fs: remove bulk remove_proc_entry() and unnecessary kobject_del()

2023-04-06 Thread Yangtao Li via Linux-f2fs-devel
Convert to use remove_proc_subtree() and kill kobject_del() directly. kobject_put() actually covers kobject removal automatically, which is single stage removal. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/fs/

[f2fs-dev] [PATCH] f2fs: remove batched_trim_sections node description

2023-04-04 Thread Yangtao Li via Linux-f2fs-devel
It's deprecated since commit 377224c47118 ("f2fs: don't split checkpoint in fstrim"). Signed-off-by: Yangtao Li --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 -- 1 file changed, 6 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs

[f2fs-dev] [PATCH 1/2] f2fs: remove unnecessary kobject_del()

2023-04-04 Thread Yangtao Li via Linux-f2fs-devel
kobject_put() actually covers kobject removal automatically, which is single stage removal. So it is safe to kill kobject_del() directly. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index dfbd17802549..d571

Re: [f2fs-dev] [PATCH v3 01/10] kobject: introduce kobject_del_and_put()

2023-04-04 Thread Yangtao Li via Linux-f2fs-devel
> kobject_put() actually covers kobject removal automatically, which is > single stage removal. So if you see the two called together, it is > safe to kill kobject_del() directly. If the reference count is not abnormal, kobject_put() does contain what kobject_del() does. Thx, Yangtao __

[f2fs-dev] [PATCH v2] f2fs: remove struct victim_selection default_v_ops

2023-04-03 Thread Yangtao Li via Linux-f2fs-devel
There is only single instance of these ops, and Jaegeuk point out that: Originally this was intended to give a chance to provide other allocation option. Anyway, it seems quit hard to do it anymore. So remove the indirection and call f2fs_get_victim() directly. Signed-off-by: Yangtao Li

[f2fs-dev] [PATCH v2] f2fs: add sanity compress level check for compressed file

2023-04-03 Thread Yangtao Li via Linux-f2fs-devel
Commit 3fde13f817e2 ("f2fs: compress: support compress level") forgot to do basic compress level check, let's add it. Signed-off-by: Yangtao Li --- v2: -convert to zstd_max_clevel() fs/f2fs/inode.c | 96 ++--- 1 file changed, 67 insertions(+), 29 delet

Re: [f2fs-dev] [RESEND] f2fs: add sanity compress level check for compressed file

2023-04-03 Thread Yangtao Li via Linux-f2fs-devel
Hi Chao, > Why not zstd_max_clevel()? zstd_max_clevel() is only defined when CONFIG_F2FS_FS_ZSTD is enabled, using zstd_max_clevel() will result in compile errors otherwise. If using the following code, switch

[f2fs-dev] [PATCH v5] f2fs: support FAULT_LOCK type fault injection

2023-04-03 Thread Yangtao Li via Linux-f2fs-devel
Similar to FAULT_LOCK_OP, this patch supports to inject fault into variant of _trylock(), including: - inode_trylock - down_read_trylock - down_write_trylock - mutex_trylock - sb_start_write_trylock - trylock_page Usage: a) echo 524288 > /sys/fs/f2fs//inject_type or b) mount -o fau

[f2fs-dev] [PATCH] f2fs: remove struct victim_selection default_v_ops

2023-04-03 Thread Yangtao Li via Linux-f2fs-devel
There is only single instance of these ops, so remove the indirection and call get_victim_by_default directly. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h| 5 - fs/f2fs/gc.c | 12 +++- fs/f2fs/segment.c | 7 --- fs/f2fs/segment.h | 7 --- 4 files changed, 11 inse

[f2fs-dev] [PATCH v4] f2fs: support FAULT_LOCK type fault injection

2023-04-02 Thread Yangtao Li via Linux-f2fs-devel
Similar to FAULT_LOCK_OP, this patch supports to inject fault into variant of _trylock(), including: - inode_trylock - down_read_trylock - down_write_trylock - mutex_trylock - sb_start_write_trylock - trylock_page Usage: a) echo 524288 > /sys/fs/f2fs//inject_type or b) mount -o fau

Re: [f2fs-dev] f2fs: support fault injection for f2fs_down_write_trylock()

2023-03-31 Thread Yangtao Li via Linux-f2fs-devel
> I guess we can cover all trylock w/ FAULT_LOCK_OP type fault injection, > rather than just cover f2fs_down_write_trylock(). > > Including: > - inode_trylock > - down_read_trylock > - down_write_trylock > - mutex_trylock > - sb_start_write_trylock > - trylock_page > > Bug only excluding f2fs_try

[f2fs-dev] [PATCH v3] f2fs: support fault injection for *_trylock()

2023-03-31 Thread Yangtao Li via Linux-f2fs-devel
This patch extends the fault injection of FAULT_LOCK_OP type, including: - inode_trylock - down_read_trylock - down_write_trylock - mutex_trylock - sb_start_write_trylock - trylock_page Since it supports not only the original lock_op fault injection, let's rename lock_op to lock. Sign

[f2fs-dev] [PATCH] f2fs: convert to use sysfs_emit

2023-03-31 Thread Yangtao Li via Linux-f2fs-devel
Let's use sysfs_emit. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9ddc6ee19433..2c0b2cb05a3a 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -312,19 +312,13 @@ static ss

[f2fs-dev] [PATCH] f2fs: support to show noage_extent_cache mount option

2023-03-30 Thread Yangtao Li via Linux-f2fs-devel
This patch support noage_extent_cache mount option. Signed-off-by: Yangtao Li --- Documentation/filesystems/f2fs.rst | 2 ++ fs/f2fs/super.c| 7 +++ 2 files changed, 9 insertions(+) diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst ind

[f2fs-dev] [RESEND] f2fs: set default compress option only when sb_has_compression

2023-03-30 Thread Yangtao Li via Linux-f2fs-devel
If the compress feature is not enabled, there is no need to set compress-related parameters. Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 768be1c76a47..b5828a67f7c1 100644 ---

[f2fs-dev] [PATCH v2] f2fs: merge lz4hc_compress_pages() to lz4_compress_pages()

2023-03-30 Thread Yangtao Li via Linux-f2fs-devel
Remove unnecessary lz4hc_compress_pages(). Signed-off-by: Yangtao Li --- v2: -rebase fs/f2fs/compress.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 3182e1506252..f8b15c932c97 100644 --- a/fs/f2fs/comp

[f2fs-dev] [RESEND] f2fs: add sanity compress level check for compressed file

2023-03-30 Thread Yangtao Li via Linux-f2fs-devel
Commit 3fde13f817e2 ("f2fs: compress: support compress level") forgot to do basic compress level check, let's add it. Signed-off-by: Yangtao Li --- fs/f2fs/inode.c | 94 + include/linux/zstd_lib.h| 3 ++ lib/zstd/compress/clevels.h | 4 -- 3

Re: [f2fs-dev] [RFC PATCH] f2fs: expand f2fs_compr_option to allow ioctl setting compression level

2023-03-30 Thread Yangtao Li via Linux-f2fs-devel
Hi Sheng Yong, Your idea, I also put forward before. And has been sent to version 2, but Chao and Jaegeuk have no comments yet. Time to talk about the series? https://lore.kernel.org/linux-f2fs-devel/20230112133503.16802-1-frank...@vivo.com/ Thx, Yangtao __

[f2fs-dev] [PATCH v2] f2fs: support fault injection for f2fs_down_write_trylock()

2023-03-30 Thread Yangtao Li via Linux-f2fs-devel
Similar to FAULT_LOCK_OP, this patch supports to inject fault into f2fs_down_write_trylock(). Usage: a) echo 524288 > /sys/fs/f2fs//inject_type or b) mount -o fault_type=524288 Signed-off-by: Yangtao Li --- v2: -remove f2fs_down_write_trylock macro Documentation/ABI/testing/sysfs-fs-f2fs

[f2fs-dev] [PATCH v3] f2fs: add iostat latency statistics support for discard

2023-03-30 Thread Yangtao Li via Linux-f2fs-devel
In this patch, it adds to account discard latency. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202303211005.rgxljvli-...@intel.com/ Signed-off-by: Yangtao Li --- v3: -force conversion to enum iostat_lat_type type v2: -rename get_bio_iostat_private to iostat_get_bio

[f2fs-dev] [PATCH v3 02/10] f2fs: convert to kobject_del_and_put()

2023-03-22 Thread Yangtao Li via Linux-f2fs-devel
Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9ddc6ee19433..b455af

[f2fs-dev] [PATCH v3 01/10] kobject: introduce kobject_del_and_put()

2023-03-22 Thread Yangtao Li via Linux-f2fs-devel
There are plenty of using kobject_del() and kobject_put() together in the kernel tree. This patch wraps these two calls in a single helper. Signed-off-by: Yangtao Li --- v3: -convert to inline helper v2: -add kobject_del_and_put() users include/linux/kobject.h | 13 + lib/kobject.c

[f2fs-dev] [RESEND, PATCH v2 02/10] f2fs: convert to kobject_del_and_put()

2023-03-20 Thread Yangtao Li via Linux-f2fs-devel
Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9ddc6ee19433..b455af

[f2fs-dev] [RESEND, PATCH v2 01/10] kobject: introduce kobject_del_and_put()

2023-03-20 Thread Yangtao Li via Linux-f2fs-devel
There are plenty of using kobject_del() and kobject_put() together in the kernel tree. This patch wraps these two calls in a single helper. Signed-off-by: Yangtao Li --- v2: -add kobject_del_and_put() users resend patchset to gregkh, Rafael and Damien include/linux/kobject.h | 1 + lib/kobject.

[f2fs-dev] [PATCH v2] f2fs: add iostat latency statistics support for discard

2023-03-20 Thread Yangtao Li via Linux-f2fs-devel
In this patch, it adds to account discard latency. Signed-off-by: Yangtao Li --- v2: -rename get_bio_iostat_private to iostat_get_bio_private fs/f2fs/data.c | 2 +- fs/f2fs/f2fs.h | 1 + fs/f2fs/iostat.c| 83 + fs/f2fs/i

[f2fs-dev] [PATCH] f2fs: remove else in f2fs_write_cache_pages()

2023-03-20 Thread Yangtao Li via Linux-f2fs-devel
As Christoph Hellwig point out: Please avoid the else by doing the goto in the branch. Signed-off-by: Yangtao Li --- fs/f2fs/data.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index bf51e6e4eb64..fa931fb768e7 100644 --- a/fs

[f2fs-dev] [PATCH v2] f2fs: compress: fix to call f2fs_wait_on_page_writeback() in f2fs_write_raw_pages()

2023-03-20 Thread Yangtao Li via Linux-f2fs-devel
BUG_ON() will be triggered when writing files concurrently, because the same page is writtenback multiple times. 1597 void folio_end_writeback(struct folio *folio) 1598 { .. 1618 if (!__folio_end_writeback(folio)) 1619 BUG(); .. 1625 } kernel BU

Re: [f2fs-dev] [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put()

2023-03-20 Thread Yangtao Li via Linux-f2fs-devel
Hi filesystem maintainers, > Hard to comment on patches with this. It is only 10 patches. So send > everything please. If you are interested in the entire patchset besides Damien, please let me know. I'll resend the email later to cc more people. Thx, Yangtao _

Re: [f2fs-dev] [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put()

2023-03-19 Thread Yangtao Li via Linux-f2fs-devel
Hi all, Out of consideration for minimizing disruption, I did not send the patchset to everyone. However, it seems that my consideration was unnecessary, so I CC'd everyone on the first patch. If you would like to see the entire patchset, you can access it at this address. https://lore.kernel.org

[f2fs-dev] [PATCH v2, RESEND 02/10] f2fs: convert to kobject_del_and_put()

2023-03-19 Thread Yangtao Li via Linux-f2fs-devel
Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9ddc6ee19433..b455afc12cfc 100644 --- a/

[f2fs-dev] [PATCH v2 02/10] f2fs: convert to kobject_del_and_put()

2023-03-19 Thread Yangtao Li via Linux-f2fs-devel
Use kobject_del_and_put() to simplify code. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9ddc6ee19433..b455afc12cfc 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -1478,14

[f2fs-dev] [RESEND] f2fs: convert is_extension_exist() to return bool type

2023-03-19 Thread Yangtao Li via Linux-f2fs-devel
is_extension_exist() only return two values, 0 or 1. So there is no need to use int type. Signed-off-by: Yangtao Li --- Resend this patch because there is no similar patch to merge in this time. fs/f2fs/namei.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f

  1   2   3   >