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.
>
>
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
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
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:
>>
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
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
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
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
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
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
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
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
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
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
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
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
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
>
> 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
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
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
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
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
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
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
> > >
>
> 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:
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:
>
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
> > > 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.
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
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
[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
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
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
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
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
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
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-
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
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
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
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
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
42 matches
Mail list logo