[f2fs-dev] [PATCH v5] f2fs: Optimize f2fs_truncate_data_blocks_range()

2025-01-14 Thread Yi Sun
@blkstart records the number of consecutive blocks. Signed-off-by: Yi Sun --- fs/f2fs/file.c | 29 + 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index c43d64898d8b..00fcac45f1bb 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs

[f2fs-dev] 答复: [PATCH v4 4/4] f2fs: Optimize f2fs_truncate_data_blocks_range()

2025-01-14 Thread Yi Sun
> -邮件原件- > 发件人: Chao Yu > 发送时间: 2025年1月14日 12:29 > 收件人: 孙毅 (Yi Sun) ; jaeg...@kernel.org > 抄送: c...@kernel.org; sunyib...@gmail.com; linux-f2fs- > de...@lists.sourceforge.net; linux-ker...@vger.kernel.org; > niuzhigu...@gmail.com; 王皓 (Hao_hao Wang) ; > 王科 (Ke Wa

[f2fs-dev] [PATCH] f2fs: Clean up the loop outside of f2fs_invalidate_blocks()

2025-01-12 Thread Yi Sun
Now f2fs_invalidate_blocks() supports a continuous range of addresses, so the for loop can be omitted. Signed-off-by: Yi Sun Signed-off-by: Zhiguo Niu --- fs/f2fs/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 9980d17ef9f5

[f2fs-dev] [PATCH v4 0/4] Speed up f2fs truncate

2024-12-23 Thread Yi Sun
3.27s 54.39% v4: - introduce update_sit_entry_for_alloc(). - [patch 2,3,4 / 4] have no changes compared to v3. Yi Sun (4): f2fs: introduce update_sit_entry_for_release/alloc() f2fs: update_sit_entry_for_release() supports consecutive blocks. f2fs: add parameter @

[f2fs-dev] [PATCH v4 4/4] f2fs: Optimize f2fs_truncate_data_blocks_range()

2024-12-23 Thread Yi Sun
Function f2fs_invalidate_blocks() can process continuous blocks at a time, so f2fs_truncate_data_blocks_range() is optimized to use the new functionality of f2fs_invalidate_blocks(). Signed-off-by: Yi Sun --- fs/f2fs/file.c | 72 +++--- 1 file changed

[f2fs-dev] [PATCH v4 1/4] f2fs: introduce update_sit_entry_for_release/alloc()

2024-12-23 Thread Yi Sun
No logical changes, just for cleanliness. Signed-off-by: Yi Sun --- fs/f2fs/segment.c | 162 ++ 1 file changed, 93 insertions(+), 69 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 86e547f008f9..bc761d9b889a 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH v4 3/4] f2fs: add parameter @len to f2fs_invalidate_blocks()

2024-12-23 Thread Yi Sun
New function can process some consecutive blocks at a time. Function f2fs_invalidate_blocks()->down_write() and up_write() are very time-consuming, so if f2fs_invalidate_blocks() can process consecutive blocks at one time, it will save a lot of time. Signed-off-by: Yi Sun --- fs/f

[f2fs-dev] [PATCH v4 2/4] f2fs: update_sit_entry_for_release() supports consecutive blocks.

2024-12-23 Thread Yi Sun
This function can process some consecutive blocks at a time. When using update_sit_entry() to release consecutive blocks, ensure that the consecutive blocks belong to the same segment. Because after update_sit_entry_for_realese(), @segno is still in use in update_sit_entry(). Signed-off-by: Yi

Re: [f2fs-dev] [PATCH v3 5/5] f2fs: Optimize f2fs_truncate_data_blocks_range()

2024-12-18 Thread yi sun
On Fri, Dec 13, 2024 at 12:22 AM Jaegeuk Kim wrote: > > On 12/11, yi sun wrote: > > Kindly ping. > > I think there are no problems with the first few patches, but the > > current patch may still have room for improvement. Do you have any > > good suggestions? &g

Re: [f2fs-dev] [PATCH v3 5/5] f2fs: Optimize f2fs_truncate_data_blocks_range()

2024-12-10 Thread yi sun
Kindly ping. I think there are no problems with the first few patches, but the current patch may still have room for improvement. Do you have any good suggestions? On Mon, Nov 4, 2024 at 11:46 AM Yi Sun wrote: > > Function f2fs_invalidate_blocks() can process continuous > blocks at a

[f2fs-dev] [PATCH v3 4/5] f2fs: add parameter @len to f2fs_invalidate_blocks()

2024-11-03 Thread Yi Sun
New function can process some consecutive blocks at a time. Function f2fs_invalidate_blocks()->down_write() and up_write() are very time-consuming, so if f2fs_invalidate_blocks() can process consecutive blocks at one time, it will save a lot of time. Signed-off-by: Yi Sun --- fs/f

[f2fs-dev] [PATCH v3 5/5] f2fs: Optimize f2fs_truncate_data_blocks_range()

2024-11-03 Thread Yi Sun
Function f2fs_invalidate_blocks() can process continuous blocks at a time, so f2fs_truncate_data_blocks_range() is optimized to use the new functionality of f2fs_invalidate_blocks(). Signed-off-by: Yi Sun --- fs/f2fs/file.c | 72 +++--- 1 file changed

[f2fs-dev] [PATCH v3 2/5] f2fs: add parameter @len to f2fs_invalidate_internal_cache()

2024-11-03 Thread Yi Sun
New function can process some consecutive blocks at a time. Signed-off-by: Yi Sun Reviewed-by: Chao Yu --- fs/f2fs/data.c| 2 +- fs/f2fs/f2fs.h| 6 +++--- fs/f2fs/gc.c | 2 +- fs/f2fs/segment.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/f2fs

[f2fs-dev] [PATCH v3 3/5] f2fs: introduce update_sit_entry_for_release()

2024-11-03 Thread Yi Sun
This function can process some consecutive blocks at a time. When using update_sit_entry() to release consecutive blocks, ensure that the consecutive blocks belong to the same segment. Because after update_sit_entry_for_realese(), @segno is still in use in update_sit_entry(). Signed-off-by: Yi

[f2fs-dev] [PATCH v3 0/5] Speed up f2fs truncate

2024-11-03 Thread Yi Sun
3.27s 54.39% Yi Sun (5): f2fs: expand f2fs_invalidate_compress_page() to f2fs_invalidate_compress_pages_range() f2fs: add parameter @len to f2fs_invalidate_internal_cache() f2fs: introduce update_sit_entry_for_release() f2fs: add parameter @len to f2fs_invalidate_blocks()

[f2fs-dev] [PATCH v3 1/5] f2fs: expand f2fs_invalidate_compress_page() to f2fs_invalidate_compress_pages_range()

2024-11-03 Thread Yi Sun
New function f2fs_invalidate_compress_pages_range() adds the @len parameter. So it can process some consecutive blocks at a time. Signed-off-by: Yi Sun --- fs/f2fs/compress.c | 5 +++-- fs/f2fs/f2fs.h | 9 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/f2fs

Re: [f2fs-dev] [PATCH v2 4/5] f2fs: add parameter @len to f2fs_invalidate_blocks()

2024-10-31 Thread yi sun
On Thu, Oct 31, 2024 at 1:00 AM Daeho Jeong wrote: > > On Wed, Oct 30, 2024 at 3:35 AM Yi Sun wrote: > > > > New function can process some consecutive blocks at a time. > > > > Function f2fs_invalidate_blocks()->down_write() and up_write() &

Re: [f2fs-dev] [PATCH v2 4/5] f2fs: add parameter @len to f2fs_invalidate_blocks()

2024-10-31 Thread yi sun
On Thu, Oct 31, 2024 at 5:10 PM Zhiguo Niu wrote: > > yi sun 于2024年10月31日周四 11:00写道: > > > > On Thu, Oct 31, 2024 at 1:00 AM Daeho Jeong wrote: > > > > > > On Wed, Oct 30, 2024 at 3:35 AM Yi Sun wrote: > > > > > > > >

Re: [f2fs-dev] [PATCH v2 2/5] f2fs: expand f2fs_invalidate_compress_page() to f2fs_invalidate_compress_pages_range()

2024-10-31 Thread yi sun
On Thu, Oct 31, 2024 at 3:26 PM Chao Yu wrote: > > On 2024/10/30 18:31, Yi Sun wrote: > > New function f2fs_invalidate_compress_pages_range() adds the @len > > parameter. So it can process some consecutive blocks at a time. > > > > Signed-off-by: Yi Sun > &

Re: [f2fs-dev] [PATCH v2 4/5] f2fs: add parameter @len to f2fs_invalidate_blocks()

2024-10-30 Thread yi sun
On Thu, Oct 31, 2024 at 1:00 AM Daeho Jeong wrote: > > On Wed, Oct 30, 2024 at 3:35 AM Yi Sun wrote: > > > > New function can process some consecutive blocks at a time. > > > > Function f2fs_invalidate_blocks()->down_write() and up_write() &

[f2fs-dev] [PATCH v2 1/5] f2fs: blocks need to belong to the same segment when using update_sit_entry()

2024-10-30 Thread Yi Sun
When using update_sit_entry() to release consecutive blocks, ensure that the consecutive blocks belong to the same segment. Because after update_sit_entry_for_realese(), @segno is still in use in update_sit_entry(). Signed-off-by: Yi Sun --- fs/f2fs/segment.c | 11 +++ 1 file changed

[f2fs-dev] [PATCH v2 2/5] f2fs: expand f2fs_invalidate_compress_page() to f2fs_invalidate_compress_pages_range()

2024-10-30 Thread Yi Sun
New function f2fs_invalidate_compress_pages_range() adds the @len parameter. So it can process some consecutive blocks at a time. Signed-off-by: Yi Sun --- fs/f2fs/compress.c | 7 --- fs/f2fs/f2fs.h | 9 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fs/f2fs

[f2fs-dev] [PATCH v2 5/5] f2fs: Optimize f2fs_truncate_data_blocks_range()

2024-10-30 Thread Yi Sun
Function f2fs_invalidate_blocks() can process continuous blocks at a time, so f2fs_truncate_data_blocks_range() is optimized to use the new functionality of f2fs_invalidate_blocks(). Signed-off-by: Yi Sun --- fs/f2fs/file.c | 72 +++--- 1 file changed

[f2fs-dev] [PATCH v2 3/5] f2fs: add parameter @len to f2fs_invalidate_internal_cache()

2024-10-30 Thread Yi Sun
New function can process some consecutive blocks at a time. Signed-off-by: Yi Sun --- fs/f2fs/data.c| 2 +- fs/f2fs/f2fs.h| 6 +++--- fs/f2fs/gc.c | 2 +- fs/f2fs/segment.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c

[f2fs-dev] [PATCH v2 0/5] Speed up f2fs truncate

2024-10-30 Thread Yi Sun
3.27s 54.39% Yi Sun (5): f2fs: blocks need to belong to the same segment when using update_sit_entry() f2fs: expand f2fs_invalidate_compress_page() to f2fs_invalidate_compress_pages_range() f2fs: add parameter @len to f2fs_invalidate_internal_cache() f2fs: add parameter @

[f2fs-dev] [PATCH v2 4/5] f2fs: add parameter @len to f2fs_invalidate_blocks()

2024-10-30 Thread Yi Sun
New function can process some consecutive blocks at a time. Function f2fs_invalidate_blocks()->down_write() and up_write() are very time-consuming, so if f2fs_invalidate_blocks() can process consecutive blocks at one time, it will save a lot of time. Signed-off-by: Yi Sun --- fs/f

Re: [f2fs-dev] [RFC PATCH 2/2] f2fs: introduce f2fs_invalidate_consecutive_blocks()

2024-10-28 Thread yi sun
On Thu, Oct 24, 2024 at 6:26 PM Chao Yu wrote: > > On 2024/10/24 17:54, yi sun wrote: > > On Thu, Oct 17, 2024 at 9:40 AM Chao Yu wrote: > >> > >> On 2024/10/16 13:27, Yi Sun wrote: > >>> When doing truncate, consecutive blocks in the same segment > &

Re: [f2fs-dev] [RFC PATCH 2/2] f2fs: introduce f2fs_invalidate_consecutive_blocks()

2024-10-24 Thread yi sun
On Thu, Oct 17, 2024 at 9:40 AM Chao Yu wrote: > > On 2024/10/16 13:27, Yi Sun wrote: > > When doing truncate, consecutive blocks in the same segment > > can be processed at the same time. So that the efficiency of > > doing truncate can

[f2fs-dev] [RFC PATCH 2/2] f2fs: introduce f2fs_invalidate_consecutive_blocks()

2024-10-15 Thread Yi Sun
to determine whether the blocks are continuous and belong to the same segment. Signed-off-by: Yi Sun --- fs/f2fs/compress.c | 14 ++ fs/f2fs/f2fs.h | 5 + fs/f2fs/file.c | 34 +- fs/f2fs/segment.c | 25 + 4 files

[f2fs-dev] [RFC PATCH 1/2] f2fs: introduce update_sit_entry_for_release()

2024-10-15 Thread Yi Sun
This function can process some consecutive blocks at a time. Signed-off-by: Yi Sun --- fs/f2fs/segment.c | 91 +-- 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index d91fbd1b27ba..f118faf36d35

[f2fs-dev] [RFC PATCH 0/2] Speed up f2fs truncate

2024-10-15 Thread Yi Sun
blocks() are not general functions. Is this modification acceptable? Yi Sun (2): f2fs: introduce update_sit_entry_for_release() f2fs: introduce f2fs_invalidate_consecutive_blocks() for truncate fs/f2fs/compress.c | 14 ++ fs/f2fs/f2fs.h | 5 ++ fs/f2fs/file.c | 34 +++

Re: [f2fs-dev] [PATCH v2 1/2] workqueue: new struct io_work

2024-07-02 Thread yi sun
; > Hello, > > > > On Mon, Jul 01, 2024 at 03:51:37PM +0800, Yi Sun wrote: > > > +/* > > > + * If a work may do disk IO, it is recommended to use struct io_work > > > + * instead of struct work_struct. > > > + */ > > > +struct io_work { >

[f2fs-dev] [PATCH v2 1/2] workqueue: new struct io_work

2024-07-01 Thread Yi Sun
set_io_work_ioprio() to set the io priority of io work, new function may_adjust_io_work_task_ioprio() to adjust kworker's io priority, new function restore_io_work_task_ioprio() to restore kworker's io priority. Signed-off-by: Yi Sun --- include/linux/workqu

[f2fs-dev] [PATCH v2 2/2] f2fs: set io priority for fsverity work

2024-07-01 Thread Yi Sun
hash blocks, which eventually causes the high-task-priority process to response slowly. Signed-off-by: Yi Sun --- fs/f2fs/data.c | 17 ++--- fs/f2fs/f2fs.h | 1 + fs/f2fs/verity.c | 5 + 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/data.c b/fs

[f2fs-dev] [PATCH v2 0/2] new struct io_work and use it in f2fs fsverity work

2024-07-01 Thread Yi Sun
the kworker's io priority is too low. A new work struct containing io priority can solve this problem. Yi Sun (2): workqueue: new struct io_work f2fs: set io priority for fsverity work fs/f2fs/data.c| 17 +++-- fs/f2fs/f2fs.h| 1 + fs/f2fs/ver

[f2fs-dev] [PATCH 1/2] workqueue: add io priority to work_struct

2024-06-20 Thread Yi Sun
priority of this work. Add function may_adjust_work_task_ioprio() to adjust kworker's io priority. Add function restore_work_task_ioprio() to restore kworker's io priority. Signed-off-by: Yi Sun --- include/linux/workqueue.h | 9 ++ include/linux/workqueue_types.h | 6 ++

[f2fs-dev] [PATCH 0/2] add io priority feature to work and use it in f2fs fsverity work

2024-06-20 Thread Yi Sun
the kworker's io priority is too low. Patch 1: Provide a set of interfaces for temporarily changing the io priority of kworker. Patch 2: Use the interfaces provided in patch1 to temporarily change the io priority of f2fs_verify_bio work. Yi Sun (2): workqueue: add io priority to work_struct

[f2fs-dev] [PATCH 2/2] f2fs: set f2fs verify work io priority

2024-06-20 Thread Yi Sun
hash blocks, which eventually causes the high-task-priority process to response slowly. Signed-off-by: Yi Sun --- fs/f2fs/data.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b9b0debc6b3d..705a2bdf0848 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/d