Re: [f2fs-dev] [PATCH v2 00/16] Parallelizing filesystem writeback

2025-11-10 Thread Kundan Kumar
On 11/7/2025 7:07 PM, Christoph Hellwig wrote: > On Fri, Nov 07, 2025 at 02:54:42PM +0530, Kundan Kumar wrote: >> Predicting the Allocation Group (AG) for aged filesystems and passing >> this information to per-AG writeback threads appears to be a complex >> task. > >

Re: [f2fs-dev] [PATCH v2 00/16] Parallelizing filesystem writeback

2025-11-07 Thread Kundan Kumar
On 10/29/2025 2:25 PM, Christoph Hellwig wrote: > On Tue, Oct 28, 2025 at 11:09:32PM -0700, Darrick J. Wong wrote: >> Was that with or without rtgroups? metadir/rtgroups aren't enabled by >> default yet so you'd have to select that manually with mkfs.xfs -m >> metadir=1. >> >> (and you might still

Re: [f2fs-dev] [PATCH v2 00/16] Parallelizing filesystem writeback

2025-10-28 Thread Kundan Kumar
On 10/22/2025 10:09 AM, Christoph Hellwig wrote: > On Tue, Oct 21, 2025 at 09:46:30AM +1100, Dave Chinner wrote: >> Not necessarily. The allocator can (and will) select different AGs >> for an inode as the file grows and the AGs run low on space. Once >> they select a different AG for an inode, the

Re: [f2fs-dev] [PATCH v2 00/16] Parallelizing filesystem writeback

2025-10-23 Thread Kundan Kumar
On 10/21/2025 5:41 PM, Jan Kara wrote: > On Tue 21-10-25 16:06:22, Kundan Kumar wrote: >> Previous results of fragmentation were taken with randwrite. I took >> fresh data for sequential IO and here are the results. >> number of extents reduces a lot for seq IO: >>

Re: [f2fs-dev] [PATCH v2 00/16] Parallelizing filesystem writeback

2025-10-21 Thread Kundan Kumar
On 10/21/2025 4:16 AM, Dave Chinner wrote: Thanks Dave for the detailed feedback. > On Tue, Oct 14, 2025 at 05:38:29PM +0530, Kundan Kumar wrote: >> Number of writeback contexts >> >> We've implemented two interfaces to manage the numbe

[f2fs-dev] [PATCH v2 02/16] writeback: add support to initialize and free multiple writeback ctxs

2025-10-18 Thread Kundan Kumar
Introduce a new macro for_each_bdi_wb_ctx to iterate over multiple writeback ctxs. Added logic for allocation, init, free, registration and unregistration of multiple writeback contexts within a bdi. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- include/linux/backing-dev.h | 4

[f2fs-dev] [PATCH v2 10/16] fuse: add support for multiple writeback contexts in fuse

2025-10-18 Thread Kundan Kumar
Made a helper to fetch writeback context to which an inode is affined. Use it to perform writeback related operations. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fuse/file.c | 7 +++ include/linux/backing-dev.h | 17 + 2 files changed, 20

[f2fs-dev] [PATCH v2 09/16] f2fs: add support in f2fs to handle multiple writeback contexts

2025-10-18 Thread Kundan Kumar
Add support to handle multiple writeback contexts and check for dirty_exceeded across all the writeback contexts. Made a new helper for same. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/f2fs/node.c | 4 ++-- fs/f2fs/segment.h | 2 +- include/linux

[f2fs-dev] [PATCH v2 12/16] nfs: add support in nfs to handle multiple writeback contexts

2025-10-18 Thread Kundan Kumar
Fetch writeback context to which an inode is affined. Use it to perform writeback related operations. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/nfs/internal.h | 3 +-- fs/nfs/write.c| 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/nfs/internal.h

[f2fs-dev] [PATCH v2 14/16] writeback: segregated allocation and free of writeback contexts

2025-10-18 Thread Kundan Kumar
The independent functions of alloc and free will be used while changing the number of writeback contexts. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 72 1 file changed, 49 insertions(+), 23 deletions(-) diff

[f2fs-dev] [PATCH v2 00/16] Parallelizing filesystem writeback

2025-10-18 Thread Kundan Kumar
affecting f2fs, fuse, gfs2 and nfs (Christoph) - Changed name from wb_ctx_arr to wb_ctx (Andrew Morton) Kundan Kumar (16): writeback: add infra for parallel writeback writeback: add support to initialize and free multiple writeback ctxs writeback: link bdi_writeback to its correspondi

[f2fs-dev] [PATCH v2 03/16] writeback: link bdi_writeback to its corresponding bdi_writeback_ctx

2025-10-18 Thread Kundan Kumar
Introduce a bdi_writeback_ctx field in bdi_writeback. This helps in fetching the writeback context from the bdi_writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/backing

[f2fs-dev] [PATCH v2 05/16] writeback: modify bdi_writeback search logic to search across all wb ctxs

2025-10-18 Thread Kundan Kumar
Since we have multiple cgwb per bdi, embedded in writeback_ctx now, we iterate over all of them to find the associated writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/fs

[f2fs-dev] [PATCH v2 16/16] writeback: added XFS support for matching writeback count to allocation group count

2025-10-18 Thread Kundan Kumar
Implemented bdi_inc_writeback() to increase the writeback context count and called this function at XFS mount time to set the desired count. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/xfs/xfs_super.c | 2 ++ include/linux/backing-dev.h | 1 + mm/backing-dev.c

[f2fs-dev] [PATCH v2 15/16] writeback: added support to change the number of writebacks using a sysfs attribute

2025-10-17 Thread Kundan Kumar
des of the superblock and flush the pages - shutdown and free the writeback threads - allocate and register the wb threads - thaw the filesystem Suggested-by: Christoph Hellwig Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/super.c | 23 + include/li

[f2fs-dev] [PATCH v2 11/16] gfs2: add support in gfs2 to handle multiple writeback contexts

2025-10-17 Thread Kundan Kumar
Add support to handle multiple writeback contexts and check for dirty_exceeded across all the writeback contexts Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/gfs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index

[f2fs-dev] [PATCH v2 06/16] writeback: invoke all writeback contexts for flusher and dirtytime writeback

2025-10-17 Thread Kundan Kumar
Modify flusher and dirtytime logic to iterate through all the writeback contexts. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index

Re: [f2fs-dev] [PATCH v2 00/16] Parallelizing filesystem writeback

2025-10-17 Thread Kundan Kumar
> > Nice results. Is testing planned for other filesystems? > The changes currently improve the writeback performance for XFS only. We have introduced a callback that other filesystems can implement to decide which writeback context an inode should be affined to. This is because the decision to

[f2fs-dev] [PATCH v2 07/16] writeback: modify sync related functions to iterate over all writeback contexts

2025-10-15 Thread Kundan Kumar
Modify sync related functions to iterate over all writeback contexts. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 66 +++ 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs

[f2fs-dev] [PATCH v2 13/16] writeback: configure the num of writeback contexts between 0 and number of online cpus

2025-10-14 Thread Kundan Kumar
The number of writeback contexts can be configured, with a valid range between 0 and the number of online CPUs. Inodes are then distributed across these contexts, enabling parallel writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 6 ++ 1 file changed

[f2fs-dev] [PATCH v2 08/16] writeback: add support to collect stats for all writeback ctxs

2025-10-14 Thread Kundan Kumar
Modified stats collection to collect stats for all the writeback contexts within a bdi. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 72 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/mm/backing

[f2fs-dev] [PATCH v2 04/16] writeback: affine inode to a writeback ctx within a bdi

2025-10-14 Thread Kundan Kumar
eback context based on its Allocation Group number. Signed-off-by: Anuj Gupta Signed-off-by: Kundan Kumar --- fs/fs-writeback.c | 3 ++- fs/xfs/xfs_super.c | 13 + include/linux/backing-dev.h | 5 - include/linux/fs.h | 1 + 4 files change

[f2fs-dev] [PATCH v2 01/16] writeback: add infra for parallel writeback

2025-10-14 Thread Kundan Kumar
operate on bdi's wb, wb_list, cgwb_tree, wb_switch_rwsem, wb_waitq as these fields have now been moved to bdi_writeback_ctx. This patch mechanically replaces bdi->wb to bdi->wb_ctx[0]->wb and there is no functional change. Suggested-by: Jan Kara Signed-off-by: Anuj Gupta Signed-off-by

Re: [f2fs-dev] [PATCH 00/13] Parallelizing filesystem writeback

2025-07-04 Thread Kundan Kumar
On Thu, Jul 3, 2025 at 6:35 PM Christoph Hellwig wrote: > > On Wed, Jul 02, 2025 at 11:43:12AM -0700, Darrick J. Wong wrote: > > > On a spinning disk, random IO bandwidth remains unchanged, while > > > sequential > > > IO performance declines. However, setting nr_wb_ctx = 1 via configurable > > >

Re: [f2fs-dev] [PATCH 00/13] Parallelizing filesystem writeback

2025-06-25 Thread Kundan Kumar
> > Makes sense. It would be good to test this on a non-SMP machine, if > you can find one ;) > Tested with kernel cmdline with maxcpus=1. The parallel writeback falls back to 1 thread behavior, showing nochange in BW. - On PMEM: Base XFS: 70.7 MiB/s Parallel Writeback XFS:

Re: [f2fs-dev] [PATCH 00/13] Parallelizing filesystem writeback

2025-06-23 Thread Kundan Kumar
On Wed, Jun 11, 2025 at 9:21 PM Darrick J. Wong wrote: > > On Wed, Jun 04, 2025 at 02:52:34PM +0530, Kundan Kumar wrote: > > > > > For xfs used this command: > > > > > xfs_io -c "stat" /mnt/testfile > > > > > And for ext4 used this: >

Re: [f2fs-dev] [PATCH 00/13] Parallelizing filesystem writeback

2025-06-05 Thread Kundan Kumar
On Tue, Jun 3, 2025 at 7:35 PM Christoph Hellwig wrote: > > On Tue, Jun 03, 2025 at 04:04:45PM +0200, Christoph Hellwig wrote: > > On Tue, Jun 03, 2025 at 07:22:18PM +0530, Anuj gupta wrote: > > > > A mount option is about the worst possible interface for behavior > > > > that depends on file syst

Re: [f2fs-dev] [PATCH 00/13] Parallelizing filesystem writeback

2025-06-04 Thread Kundan Kumar
> > > For xfs used this command: > > > xfs_io -c "stat" /mnt/testfile > > > And for ext4 used this: > > > filefrag /mnt/testfile > > > > filefrag merges contiguous extents, and only counts up for discontiguous > > mappings, while fsxattr.nextents counts all extent even if they are > > contiguous.

[f2fs-dev] [PATCH 12/13] nfs: add support in nfs to handle multiple writeback contexts

2025-05-29 Thread Kundan Kumar
Fetch writeback context to which an inode is affined. Use it to perform writeback related operations. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/nfs/internal.h | 5 +++-- fs/nfs/write.c| 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/nfs

[f2fs-dev] [PATCH 13/13] writeback: set the num of writeback contexts to number of online cpus

2025-05-29 Thread Kundan Kumar
We create N number of writeback contexts, N = number of online cpus. The inodes gets distributed across different writeback contexts, enabling parallel writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[f2fs-dev] [PATCH 00/13] Parallelizing filesystem writeback

2025-05-29 Thread Kundan Kumar
[email protected]/ Kundan Kumar (13): writeback: add infra for parallel writeback writeback: add support to initialize and free multiple writeback ctxs writeback: link bdi_writeback to its corresponding bdi_writeback_ctx writeback: affine inode to a writeback ctx within

[f2fs-dev] [PATCH 09/13] f2fs: add support in f2fs to handle multiple writeback contexts

2025-05-29 Thread Kundan Kumar
Add support to handle multiple writeback contexts and check for dirty_exceeded across all the writeback contexts. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/f2fs/node.c| 11 +++ fs/f2fs/segment.h | 7 +-- 2 files changed, 12 insertions(+), 6 deletions

[f2fs-dev] [PATCH 05/13] writeback: modify bdi_writeback search logic to search across all wb ctxs

2025-05-29 Thread Kundan Kumar
Since we have multiple cgwb per bdi, embedded in writeback_ctx now, we iterate over all of them to find the associated writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/fs

[f2fs-dev] [PATCH 10/13] fuse: add support for multiple writeback contexts in fuse

2025-05-29 Thread Kundan Kumar
Fetch writeback context to which an inode is affined. Use it to perform writeback related operations. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fuse/file.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index

[f2fs-dev] [PATCH 07/13] writeback: modify sync related functions to iterate over all writeback contexts

2025-05-29 Thread Kundan Kumar
Modify sync related functions to iterate over all writeback contexts. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 66 +++ 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs

[f2fs-dev] [PATCH 08/13] writeback: add support to collect stats for all writeback ctxs

2025-05-29 Thread Kundan Kumar
Modified stats collection to collect stats for all the writeback contexts within a bdi. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 72 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/mm/backing

[f2fs-dev] [PATCH 01/13] writeback: add infra for parallel writeback

2025-05-29 Thread Kundan Kumar
operate on bdi's wb, wb_list, cgwb_tree, wb_switch_rwsem, wb_waitq as these fields have now been moved to bdi_writeback_ctx. This patch mechanically replaces bdi->wb to bdi->wb_ctx_arr[0]->wb and there is no functional change. Suggested-by: Jan Kara Signed-off-by: Anuj Gupta Signed-

[f2fs-dev] [PATCH 03/13] writeback: link bdi_writeback to its corresponding bdi_writeback_ctx

2025-05-29 Thread Kundan Kumar
Introduce a bdi_writeback_ctx field in bdi_writeback. This helps in fetching the writeback context from the bdi_writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/backing

[f2fs-dev] [PATCH 11/13] gfs2: add support in gfs2 to handle multiple writeback contexts

2025-05-29 Thread Kundan Kumar
Add support to handle multiple writeback contexts and check for dirty_exceeded across all the writeback contexts Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/gfs2/super.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2

[f2fs-dev] [PATCH 02/13] writeback: add support to initialize and free multiple writeback ctxs

2025-05-29 Thread Kundan Kumar
Introduce a new macro for_each_bdi_wb_ctx to iterate over multiple writeback ctxs. Added logic for allocation, init, free, registration and unregistration of multiple writeback contexts within a bdi. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- include/linux/backing-dev.h | 4

[f2fs-dev] [PATCH 06/13] writeback: invoke all writeback contexts for flusher and dirtytime writeback

2025-05-29 Thread Kundan Kumar
Modify flusher and dirtytime logic to iterate through all the writeback contexts. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index

[f2fs-dev] [PATCH 04/13] writeback: affine inode to a writeback ctx within a bdi

2025-05-29 Thread Kundan Kumar
Affine inode to a writeback context. This helps in minimizing the filesytem fragmentation due to inode being processed by different threads. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta Suggested-by: Ritesh Harjani (IBM) --- fs/fs-writeback.c | 3 ++- include/linux/backing