* [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
@ 2025-09-30 6:56 Julian Sun
2025-09-30 7:18 ` [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs) Julian Sun
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Julian Sun @ 2025-09-30 6:56 UTC (permalink / raw)
To: linux-fsdevel; +Cc: viro, brauner, jack
Writing back a large number of pages can take a lots of time.
This issue is exacerbated when the underlying device is slow or
subject to block layer rate limiting, which in turn triggers
unexpected hung task warnings.
We can trigger a wake-up once a chunk has been written back and the
waiting time for writeback exceeds half of
sysctl_hung_task_timeout_secs.
This action allows the hung task detector to be aware of the writeback
progress, thereby eliminating these unexpected hung task warnings.
This patch has passed the xfstests 'check -g quick' test based on ext4,
with no additional failures introduced.
Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
---
Changes in v2:
* remove code in finish_writeback_work()
* rename stamp to progress_stamp
* only report progress if there's any task waiting
fs/fs-writeback.c | 11 ++++++++++-
include/linux/backing-dev-defs.h | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index a07b8cf73ae2..61785a9d6669 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -14,6 +14,7 @@
* Additions for address_space-based writeback
*/
+#include <linux/sched/sysctl.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/spinlock.h>
@@ -213,7 +214,8 @@ static void wb_queue_work(struct bdi_writeback *wb,
void wb_wait_for_completion(struct wb_completion *done)
{
atomic_dec(&done->cnt); /* put down the initial count */
- wait_event(*done->waitq, !atomic_read(&done->cnt));
+ wait_event(*done->waitq,
+ ({ done->progress_stamp = jiffies; !atomic_read(&done->cnt); }));
}
#ifdef CONFIG_CGROUP_WRITEBACK
@@ -1893,6 +1895,7 @@ static long writeback_sb_inodes(struct super_block *sb,
long write_chunk;
long total_wrote = 0; /* count both pages and inodes */
unsigned long dirtied_before = jiffies;
+ unsigned long progress_stamp;
if (work->for_kupdate)
dirtied_before = jiffies -
@@ -1975,6 +1978,12 @@ static long writeback_sb_inodes(struct super_block *sb,
*/
__writeback_single_inode(inode, &wbc);
+ /* Report progress to inform the hung task detector of the progress. */
+ progress_stamp = work->done->progress_stamp;
+ if (work->done && progress_stamp && (jiffies - progress_stamp) >
+ HZ * sysctl_hung_task_timeout_secs / 2)
+ wake_up_all(work->done->waitq);
+
wbc_detach_inode(&wbc);
work->nr_pages -= write_chunk - wbc.nr_to_write;
wrote = write_chunk - wbc.nr_to_write - wbc.pages_skipped;
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index 2ad261082bba..1057060bb2aa 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -63,6 +63,7 @@ enum wb_reason {
struct wb_completion {
atomic_t cnt;
wait_queue_head_t *waitq;
+ unsigned long progress_stamp; /* The jiffies when slow progress is detected */
};
#define __WB_COMPLETION_INIT(_waitq) \
--
2.39.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs)
2025-09-30 6:56 [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
@ 2025-09-30 7:18 ` Julian Sun
2025-09-30 7:31 ` Jan Kara
2025-10-06 10:44 ` (subset) " Christian Brauner
2025-09-30 8:53 ` [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
2025-10-06 10:44 ` (subset) " Christian Brauner
2 siblings, 2 replies; 11+ messages in thread
From: Julian Sun @ 2025-09-30 7:18 UTC (permalink / raw)
To: sunjunchao; +Cc: brauner, jack, linux-fsdevel, viro
When a writeback work lasts for sysctl_hung_task_timeout_secs, we want
to identify that there are tasks waiting for a long time-this helps us
pinpoint potential issues.
Additionally, recording the starting jiffies is useful when debugging a
crashed vmcore.
Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
---
Changes in v3:
* Show blocked task info instead of BDI info as Jan suggested.
Changes in v2:
* rename start to wait_stamp
* init wait_stamp in wb_wait_for_completion()
fs/fs-writeback.c | 17 +++++++++++++++--
include/linux/backing-dev-defs.h | 1 +
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 61785a9d6669..4b54189f27ac 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -201,6 +201,19 @@ static void wb_queue_work(struct bdi_writeback *wb,
spin_unlock_irq(&wb->work_lock);
}
+static bool wb_wait_for_completion_cb(struct wb_completion *done)
+{
+ unsigned long waited_secs = (jiffies - done->wait_start) / HZ;
+
+ done->progress_stamp = jiffies;
+ if (waited_secs > sysctl_hung_task_timeout_secs)
+ pr_info("INFO: The task %s:%d has been waiting for writeback "
+ "completion for more than %lu seconds.",
+ current->comm, current->pid, waited_secs);
+
+ return !atomic_read(&done->cnt);
+}
+
/**
* wb_wait_for_completion - wait for completion of bdi_writeback_works
* @done: target wb_completion
@@ -213,9 +226,9 @@ static void wb_queue_work(struct bdi_writeback *wb,
*/
void wb_wait_for_completion(struct wb_completion *done)
{
+ done->wait_start = jiffies;
atomic_dec(&done->cnt); /* put down the initial count */
- wait_event(*done->waitq,
- ({ done->progress_stamp = jiffies; !atomic_read(&done->cnt); }));
+ wait_event(*done->waitq, wb_wait_for_completion_cb(done));
}
#ifdef CONFIG_CGROUP_WRITEBACK
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index 1057060bb2aa..fd71340e5562 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -64,6 +64,7 @@ struct wb_completion {
atomic_t cnt;
wait_queue_head_t *waitq;
unsigned long progress_stamp; /* The jiffies when slow progress is detected */
+ unsigned long wait_start; /* The jiffies when waiting for the writeback work to finish */
};
#define __WB_COMPLETION_INIT(_waitq) \
--
2.39.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs)
2025-09-30 7:18 ` [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs) Julian Sun
@ 2025-09-30 7:31 ` Jan Kara
2025-10-06 10:44 ` (subset) " Christian Brauner
1 sibling, 0 replies; 11+ messages in thread
From: Jan Kara @ 2025-09-30 7:31 UTC (permalink / raw)
To: Julian Sun; +Cc: brauner, jack, linux-fsdevel, viro
On Tue 30-09-25 15:18:29, Julian Sun wrote:
> When a writeback work lasts for sysctl_hung_task_timeout_secs, we want
> to identify that there are tasks waiting for a long time-this helps us
> pinpoint potential issues.
>
> Additionally, recording the starting jiffies is useful when debugging a
> crashed vmcore.
>
> Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Looks good.
Honza
> ---
> Changes in v3:
> * Show blocked task info instead of BDI info as Jan suggested.
>
> Changes in v2:
> * rename start to wait_stamp
> * init wait_stamp in wb_wait_for_completion()
>
> fs/fs-writeback.c | 17 +++++++++++++++--
> include/linux/backing-dev-defs.h | 1 +
> 2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 61785a9d6669..4b54189f27ac 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -201,6 +201,19 @@ static void wb_queue_work(struct bdi_writeback *wb,
> spin_unlock_irq(&wb->work_lock);
> }
>
> +static bool wb_wait_for_completion_cb(struct wb_completion *done)
> +{
> + unsigned long waited_secs = (jiffies - done->wait_start) / HZ;
> +
> + done->progress_stamp = jiffies;
> + if (waited_secs > sysctl_hung_task_timeout_secs)
> + pr_info("INFO: The task %s:%d has been waiting for writeback "
> + "completion for more than %lu seconds.",
> + current->comm, current->pid, waited_secs);
> +
> + return !atomic_read(&done->cnt);
> +}
> +
> /**
> * wb_wait_for_completion - wait for completion of bdi_writeback_works
> * @done: target wb_completion
> @@ -213,9 +226,9 @@ static void wb_queue_work(struct bdi_writeback *wb,
> */
> void wb_wait_for_completion(struct wb_completion *done)
> {
> + done->wait_start = jiffies;
> atomic_dec(&done->cnt); /* put down the initial count */
> - wait_event(*done->waitq,
> - ({ done->progress_stamp = jiffies; !atomic_read(&done->cnt); }));
> + wait_event(*done->waitq, wb_wait_for_completion_cb(done));
> }
>
> #ifdef CONFIG_CGROUP_WRITEBACK
> diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
> index 1057060bb2aa..fd71340e5562 100644
> --- a/include/linux/backing-dev-defs.h
> +++ b/include/linux/backing-dev-defs.h
> @@ -64,6 +64,7 @@ struct wb_completion {
> atomic_t cnt;
> wait_queue_head_t *waitq;
> unsigned long progress_stamp; /* The jiffies when slow progress is detected */
> + unsigned long wait_start; /* The jiffies when waiting for the writeback work to finish */
> };
>
> #define __WB_COMPLETION_INIT(_waitq) \
> --
> 2.39.5
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
2025-09-30 6:56 [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
2025-09-30 7:18 ` [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs) Julian Sun
@ 2025-09-30 8:53 ` Julian Sun
2025-09-30 8:59 ` Jan Kara
2025-10-06 10:44 ` (subset) " Christian Brauner
2 siblings, 1 reply; 11+ messages in thread
From: Julian Sun @ 2025-09-30 8:53 UTC (permalink / raw)
To: sunjunchao; +Cc: brauner, jack, linux-fsdevel, viro
Writing back a large number of pages can take a lots of time.
This issue is exacerbated when the underlying device is slow or
subject to block layer rate limiting, which in turn triggers
unexpected hung task warnings.
We can trigger a wake-up once a chunk has been written back and the
waiting time for writeback exceeds half of
sysctl_hung_task_timeout_secs.
This action allows the hung task detector to be aware of the writeback
progress, thereby eliminating these unexpected hung task warnings.
This patch has passed the xfstests 'check -g quick' test based on ext4,
with no additional failures introduced.
Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
---
Hi, the previous patch sent unupdated code due to an mistake;
this version is the genuine v3.
Changes in v3:
* Fix null-ptr-deref issue.
Changes in v2:
* remove code in finish_writeback_work()
* rename stamp to progress_stamp
* only report progress if there's any task waiting
fs/fs-writeback.c | 10 +++++++++-
include/linux/backing-dev-defs.h | 1 +
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index a07b8cf73ae2..40954040fd69 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -14,6 +14,7 @@
* Additions for address_space-based writeback
*/
+#include <linux/sched/sysctl.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/spinlock.h>
@@ -213,7 +214,8 @@ static void wb_queue_work(struct bdi_writeback *wb,
void wb_wait_for_completion(struct wb_completion *done)
{
atomic_dec(&done->cnt); /* put down the initial count */
- wait_event(*done->waitq, !atomic_read(&done->cnt));
+ wait_event(*done->waitq,
+ ({ done->progress_stamp = jiffies; !atomic_read(&done->cnt); }));
}
#ifdef CONFIG_CGROUP_WRITEBACK
@@ -1975,6 +1977,12 @@ static long writeback_sb_inodes(struct super_block *sb,
*/
__writeback_single_inode(inode, &wbc);
+ /* Report progress to inform the hung task detector of the progress. */
+ if (work->done && work->done->progress_stamp &&
+ (jiffies - work->done->progress_stamp) > HZ *
+ sysctl_hung_task_timeout_secs / 2)
+ wake_up_all(work->done->waitq);
+
wbc_detach_inode(&wbc);
work->nr_pages -= write_chunk - wbc.nr_to_write;
wrote = write_chunk - wbc.nr_to_write - wbc.pages_skipped;
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index 2ad261082bba..1057060bb2aa 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -63,6 +63,7 @@ enum wb_reason {
struct wb_completion {
atomic_t cnt;
wait_queue_head_t *waitq;
+ unsigned long progress_stamp; /* The jiffies when slow progress is detected */
};
#define __WB_COMPLETION_INIT(_waitq) \
--
2.39.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
2025-09-30 8:53 ` [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
@ 2025-09-30 8:59 ` Jan Kara
0 siblings, 0 replies; 11+ messages in thread
From: Jan Kara @ 2025-09-30 8:59 UTC (permalink / raw)
To: Julian Sun; +Cc: brauner, jack, linux-fsdevel, viro
On Tue 30-09-25 16:53:15, Julian Sun wrote:
> Writing back a large number of pages can take a lots of time.
> This issue is exacerbated when the underlying device is slow or
> subject to block layer rate limiting, which in turn triggers
> unexpected hung task warnings.
>
> We can trigger a wake-up once a chunk has been written back and the
> waiting time for writeback exceeds half of
> sysctl_hung_task_timeout_secs.
> This action allows the hung task detector to be aware of the writeback
> progress, thereby eliminating these unexpected hung task warnings.
>
> This patch has passed the xfstests 'check -g quick' test based on ext4,
> with no additional failures introduced.
>
> Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> Hi, the previous patch sent unupdated code due to an mistake;
> this version is the genuine v3.
>
> Changes in v3:
> * Fix null-ptr-deref issue.
>
> Changes in v2:
> * remove code in finish_writeback_work()
> * rename stamp to progress_stamp
> * only report progress if there's any task waiting
>
>
> fs/fs-writeback.c | 10 +++++++++-
> include/linux/backing-dev-defs.h | 1 +
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index a07b8cf73ae2..40954040fd69 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -14,6 +14,7 @@
> * Additions for address_space-based writeback
> */
>
> +#include <linux/sched/sysctl.h>
> #include <linux/kernel.h>
> #include <linux/export.h>
> #include <linux/spinlock.h>
> @@ -213,7 +214,8 @@ static void wb_queue_work(struct bdi_writeback *wb,
> void wb_wait_for_completion(struct wb_completion *done)
> {
> atomic_dec(&done->cnt); /* put down the initial count */
> - wait_event(*done->waitq, !atomic_read(&done->cnt));
> + wait_event(*done->waitq,
> + ({ done->progress_stamp = jiffies; !atomic_read(&done->cnt); }));
> }
>
> #ifdef CONFIG_CGROUP_WRITEBACK
> @@ -1975,6 +1977,12 @@ static long writeback_sb_inodes(struct super_block *sb,
> */
> __writeback_single_inode(inode, &wbc);
>
> + /* Report progress to inform the hung task detector of the progress. */
> + if (work->done && work->done->progress_stamp &&
> + (jiffies - work->done->progress_stamp) > HZ *
> + sysctl_hung_task_timeout_secs / 2)
> + wake_up_all(work->done->waitq);
> +
> wbc_detach_inode(&wbc);
> work->nr_pages -= write_chunk - wbc.nr_to_write;
> wrote = write_chunk - wbc.nr_to_write - wbc.pages_skipped;
> diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
> index 2ad261082bba..1057060bb2aa 100644
> --- a/include/linux/backing-dev-defs.h
> +++ b/include/linux/backing-dev-defs.h
> @@ -63,6 +63,7 @@ enum wb_reason {
> struct wb_completion {
> atomic_t cnt;
> wait_queue_head_t *waitq;
> + unsigned long progress_stamp; /* The jiffies when slow progress is detected */
> };
>
> #define __WB_COMPLETION_INIT(_waitq) \
> --
> 2.39.5
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: (subset) [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
2025-09-30 6:56 [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
2025-09-30 7:18 ` [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs) Julian Sun
2025-09-30 8:53 ` [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
@ 2025-10-06 10:44 ` Christian Brauner
2025-10-06 14:29 ` [External] " Julian Sun
2 siblings, 1 reply; 11+ messages in thread
From: Christian Brauner @ 2025-10-06 10:44 UTC (permalink / raw)
To: linux-fsdevel, Julian Sun; +Cc: Christian Brauner, viro, jack
On Tue, 30 Sep 2025 14:56:36 +0800, Julian Sun wrote:
> Writing back a large number of pages can take a lots of time.
> This issue is exacerbated when the underlying device is slow or
> subject to block layer rate limiting, which in turn triggers
> unexpected hung task warnings.
>
> We can trigger a wake-up once a chunk has been written back and the
> waiting time for writeback exceeds half of
> sysctl_hung_task_timeout_secs.
> This action allows the hung task detector to be aware of the writeback
> progress, thereby eliminating these unexpected hung task warnings.
>
> [...]
Applied to the vfs-6.19.writeback branch of the vfs/vfs.git tree.
Patches in the vfs-6.19.writeback branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.19.writeback
[1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
https://git.kernel.org/vfs/vfs/c/334b83b3ed81
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: (subset) [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs)
2025-09-30 7:18 ` [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs) Julian Sun
2025-09-30 7:31 ` Jan Kara
@ 2025-10-06 10:44 ` Christian Brauner
1 sibling, 0 replies; 11+ messages in thread
From: Christian Brauner @ 2025-10-06 10:44 UTC (permalink / raw)
To: Julian Sun; +Cc: Christian Brauner, jack, linux-fsdevel, viro
On Tue, 30 Sep 2025 15:18:29 +0800, Julian Sun wrote:
> When a writeback work lasts for sysctl_hung_task_timeout_secs, we want
> to identify that there are tasks waiting for a long time-this helps us
> pinpoint potential issues.
>
> Additionally, recording the starting jiffies is useful when debugging a
> crashed vmcore.
>
> [...]
Applied to the vfs-6.19.writeback branch of the vfs/vfs.git tree.
Patches in the vfs-6.19.writeback branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.19.writeback
[2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs)
https://git.kernel.org/vfs/vfs/c/51d8f1c7919e
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [External] Re: (subset) [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
2025-10-06 10:44 ` (subset) " Christian Brauner
@ 2025-10-06 14:29 ` Julian Sun
2025-10-07 14:37 ` Julian Sun
0 siblings, 1 reply; 11+ messages in thread
From: Julian Sun @ 2025-10-06 14:29 UTC (permalink / raw)
To: Christian Brauner; +Cc: linux-fsdevel, viro, jack
Hi Christian,
It looks like an earlier version of my patch was merged, which may
cause a null pointer dereference issue. The latest and correct version
can be found here:
https://lore.kernel.org/linux-fsdevel/20250930085315.2039852-1-sunjunchao@bytedance.com/.
Sorry for the confusion, and thank you for your time and help!
Best,
On Mon, Oct 6, 2025 at 6:44 PM Christian Brauner <brauner@kernel.org> wrote:
>
> On Tue, 30 Sep 2025 14:56:36 +0800, Julian Sun wrote:
> > Writing back a large number of pages can take a lots of time.
> > This issue is exacerbated when the underlying device is slow or
> > subject to block layer rate limiting, which in turn triggers
> > unexpected hung task warnings.
> >
> > We can trigger a wake-up once a chunk has been written back and the
> > waiting time for writeback exceeds half of
> > sysctl_hung_task_timeout_secs.
> > This action allows the hung task detector to be aware of the writeback
> > progress, thereby eliminating these unexpected hung task warnings.
> >
> > [...]
>
> Applied to the vfs-6.19.writeback branch of the vfs/vfs.git tree.
> Patches in the vfs-6.19.writeback branch should appear in linux-next soon.
>
> Please report any outstanding bugs that were missed during review in a
> new review to the original patch series allowing us to drop it.
>
> It's encouraged to provide Acked-bys and Reviewed-bys even though the
> patch has now been applied. If possible patch trailers will be updated.
>
> Note that commit hashes shown below are subject to change due to rebase,
> trailer updates or similar. If in doubt, please check the listed branch.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
> branch: vfs-6.19.writeback
>
> [1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
> https://git.kernel.org/vfs/vfs/c/334b83b3ed81
--
Julian Sun <sunjunchao@bytedance.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: (subset) [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
2025-10-06 14:29 ` [External] " Julian Sun
@ 2025-10-07 14:37 ` Julian Sun
2025-10-10 11:10 ` Christian Brauner
0 siblings, 1 reply; 11+ messages in thread
From: Julian Sun @ 2025-10-07 14:37 UTC (permalink / raw)
To: Christian Brauner; +Cc: linux-fsdevel, viro, Jan Kara
Kindly ping..
On Mon, Oct 6, 2025 at 10:29 PM Julian Sun <sunjunchao@bytedance.com> wrote:
>
> Hi Christian,
>
> It looks like an earlier version of my patch was merged, which may
> cause a null pointer dereference issue. The latest and correct version
> can be found here:
> https://lore.kernel.org/linux-fsdevel/20250930085315.2039852-1-sunjunchao@bytedance.com/.
>
> Sorry for the confusion, and thank you for your time and help!
>
> Best,
>
>
> On Mon, Oct 6, 2025 at 6:44 PM Christian Brauner <brauner@kernel.org> wrote:
> >
> > On Tue, 30 Sep 2025 14:56:36 +0800, Julian Sun wrote:
> > > Writing back a large number of pages can take a lots of time.
> > > This issue is exacerbated when the underlying device is slow or
> > > subject to block layer rate limiting, which in turn triggers
> > > unexpected hung task warnings.
> > >
> > > We can trigger a wake-up once a chunk has been written back and the
> > > waiting time for writeback exceeds half of
> > > sysctl_hung_task_timeout_secs.
> > > This action allows the hung task detector to be aware of the writeback
> > > progress, thereby eliminating these unexpected hung task warnings.
> > >
> > > [...]
> >
> > Applied to the vfs-6.19.writeback branch of the vfs/vfs.git tree.
> > Patches in the vfs-6.19.writeback branch should appear in linux-next soon.
> >
> > Please report any outstanding bugs that were missed during review in a
> > new review to the original patch series allowing us to drop it.
> >
> > It's encouraged to provide Acked-bys and Reviewed-bys even though the
> > patch has now been applied. If possible patch trailers will be updated.
> >
> > Note that commit hashes shown below are subject to change due to rebase,
> > trailer updates or similar. If in doubt, please check the listed branch.
> >
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
> > branch: vfs-6.19.writeback
> >
> > [1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
> > https://git.kernel.org/vfs/vfs/c/334b83b3ed81
>
>
>
> --
> Julian Sun <sunjunchao@bytedance.com>
--
Julian Sun <sunjunchao@bytedance.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: (subset) [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
2025-10-07 14:37 ` Julian Sun
@ 2025-10-10 11:10 ` Christian Brauner
2025-10-10 11:28 ` Julian Sun
0 siblings, 1 reply; 11+ messages in thread
From: Christian Brauner @ 2025-10-10 11:10 UTC (permalink / raw)
To: Julian Sun; +Cc: linux-fsdevel, viro, Jan Kara
On Tue, Oct 07, 2025 at 10:37:39PM +0800, Julian Sun wrote:
> Kindly ping..
Please check vfs-6.19.writeback again.
Your patch numbering is broken btw. This should've been v4 with both
patches resent. This confuses the tooling and reviewers. ;)
>
> On Mon, Oct 6, 2025 at 10:29 PM Julian Sun <sunjunchao@bytedance.com> wrote:
> >
> > Hi Christian,
> >
> > It looks like an earlier version of my patch was merged, which may
> > cause a null pointer dereference issue. The latest and correct version
> > can be found here:
> > https://lore.kernel.org/linux-fsdevel/20250930085315.2039852-1-sunjunchao@bytedance.com/.
> >
> > Sorry for the confusion, and thank you for your time and help!
> >
> > Best,
> >
> >
> > On Mon, Oct 6, 2025 at 6:44 PM Christian Brauner <brauner@kernel.org> wrote:
> > >
> > > On Tue, 30 Sep 2025 14:56:36 +0800, Julian Sun wrote:
> > > > Writing back a large number of pages can take a lots of time.
> > > > This issue is exacerbated when the underlying device is slow or
> > > > subject to block layer rate limiting, which in turn triggers
> > > > unexpected hung task warnings.
> > > >
> > > > We can trigger a wake-up once a chunk has been written back and the
> > > > waiting time for writeback exceeds half of
> > > > sysctl_hung_task_timeout_secs.
> > > > This action allows the hung task detector to be aware of the writeback
> > > > progress, thereby eliminating these unexpected hung task warnings.
> > > >
> > > > [...]
> > >
> > > Applied to the vfs-6.19.writeback branch of the vfs/vfs.git tree.
> > > Patches in the vfs-6.19.writeback branch should appear in linux-next soon.
> > >
> > > Please report any outstanding bugs that were missed during review in a
> > > new review to the original patch series allowing us to drop it.
> > >
> > > It's encouraged to provide Acked-bys and Reviewed-bys even though the
> > > patch has now been applied. If possible patch trailers will be updated.
> > >
> > > Note that commit hashes shown below are subject to change due to rebase,
> > > trailer updates or similar. If in doubt, please check the listed branch.
> > >
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
> > > branch: vfs-6.19.writeback
> > >
> > > [1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
> > > https://git.kernel.org/vfs/vfs/c/334b83b3ed81
> >
> >
> >
> > --
> > Julian Sun <sunjunchao@bytedance.com>
>
>
>
> --
> Julian Sun <sunjunchao@bytedance.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: (subset) [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
2025-10-10 11:10 ` Christian Brauner
@ 2025-10-10 11:28 ` Julian Sun
0 siblings, 0 replies; 11+ messages in thread
From: Julian Sun @ 2025-10-10 11:28 UTC (permalink / raw)
To: Christian Brauner; +Cc: linux-fsdevel, viro, Jan Kara
On 10/10/25 7:10 PM, Christian Brauner wrote:
> On Tue, Oct 07, 2025 at 10:37:39PM +0800, Julian Sun wrote:
>> Kindly ping..
>
> Please check vfs-6.19.writeback again.
Looks good to me now.>
> Your patch numbering is broken btw. This should've been v4 with both
> patches resent. This confuses the tooling and reviewers. ;)
Ah, yeah.. Sorry for the confusion, and thanks for your time.>
>>
>> On Mon, Oct 6, 2025 at 10:29 PM Julian Sun <sunjunchao@bytedance.com> wrote:
>>>
>>> Hi Christian,
>>>
>>> It looks like an earlier version of my patch was merged, which may
>>> cause a null pointer dereference issue. The latest and correct version
>>> can be found here:
>>> https://lore.kernel.org/linux-fsdevel/20250930085315.2039852-1-sunjunchao@bytedance.com/.
>>>
>>> Sorry for the confusion, and thank you for your time and help!
>>>
>>> Best,
>>>
>>>
>>> On Mon, Oct 6, 2025 at 6:44 PM Christian Brauner <brauner@kernel.org> wrote:
>>>>
>>>> On Tue, 30 Sep 2025 14:56:36 +0800, Julian Sun wrote:
>>>>> Writing back a large number of pages can take a lots of time.
>>>>> This issue is exacerbated when the underlying device is slow or
>>>>> subject to block layer rate limiting, which in turn triggers
>>>>> unexpected hung task warnings.
>>>>>
>>>>> We can trigger a wake-up once a chunk has been written back and the
>>>>> waiting time for writeback exceeds half of
>>>>> sysctl_hung_task_timeout_secs.
>>>>> This action allows the hung task detector to be aware of the writeback
>>>>> progress, thereby eliminating these unexpected hung task warnings.
>>>>>
>>>>> [...]
>>>>
>>>> Applied to the vfs-6.19.writeback branch of the vfs/vfs.git tree.
>>>> Patches in the vfs-6.19.writeback branch should appear in linux-next soon.
>>>>
>>>> Please report any outstanding bugs that were missed during review in a
>>>> new review to the original patch series allowing us to drop it.
>>>>
>>>> It's encouraged to provide Acked-bys and Reviewed-bys even though the
>>>> patch has now been applied. If possible patch trailers will be updated.
>>>>
>>>> Note that commit hashes shown below are subject to change due to rebase,
>>>> trailer updates or similar. If in doubt, please check the listed branch.
>>>>
>>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
>>>> branch: vfs-6.19.writeback
>>>>
>>>> [1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk.
>>>> https://git.kernel.org/vfs/vfs/c/334b83b3ed81
>>>
>>>
>>>
>>> --
>>> Julian Sun <sunjunchao@bytedance.com>
>>
>>
>>
>> --
>> Julian Sun <sunjunchao@bytedance.com>
Best,
--
Julian Sun <sunjunchao@bytedance.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-10-10 11:28 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-30 6:56 [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
2025-09-30 7:18 ` [PATCH v3 2/2] writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs) Julian Sun
2025-09-30 7:31 ` Jan Kara
2025-10-06 10:44 ` (subset) " Christian Brauner
2025-09-30 8:53 ` [PATCH v3 1/2] writeback: Wake up waiting tasks when finishing the writeback of a chunk Julian Sun
2025-09-30 8:59 ` Jan Kara
2025-10-06 10:44 ` (subset) " Christian Brauner
2025-10-06 14:29 ` [External] " Julian Sun
2025-10-07 14:37 ` Julian Sun
2025-10-10 11:10 ` Christian Brauner
2025-10-10 11:28 ` Julian Sun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).