From: Breno Leitao <leitao@debian.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Julian Sun <sunjunchao@bytedance.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Muchun Song <muchun.song@linux.dev>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, cgroups@vger.kernel.org,
Breno Leitao <leitao@debian.org>,
kernel-team@meta.com, stable@vger.kernel.org
Subject: [PATCH 0/4] writeback: make slow writeback report more actionable
Date: Fri, 06 Nov 2026 04:26:30 -0800 [thread overview]
Message-ID: <20261106-writeback_stall_report-v1-0-bf0c3b9023a5@debian.org> (raw)
Since v6.19, writeback waiters are woken while their writeback makes
progress, so a slow sync no longer trips the hung task detector.
Instead, a waiter past hung_task_timeout_secs logs:
INFO: The task sync:180 has been waiting for writeback completion for more than 28 seconds.
Across the Meta fleet, this line is logged about 19,000 times a day
(the median over 40 days), and up to 82,000 times on a busy day.
Over one day, 194 hosts logged 16,858 of these lines for only about
2,000 waits, half of them longer than 160 seconds. Most reports were
printed twice, and a wait logged a median of 7 lines.
Going through these reports, a few things made them hard to use and
quickly act on:
1. The message has no trailing newline, so it only shows up once the
next message is logged. Patch 1 fixes that, for stable.
2. It does not say which device is slow. Patch 2 adds the bdi and the
number of work items left.
3. The end of the wait is logged as one more "has been waiting" line.
Patch 3 logs the total wait instead.
4. It is printed every half timeout, often twice. Patch 4 prints it
once per timeout.
With the series, a sync of files dirtied from two cgroups, on a null_blk
device throttled to 4 MB/s and with hung_task_timeout_secs set to 5,
logs:
[ 7.632999] INFO: The task sync:275 has been waiting for writeback completion for more than 5 seconds.
[ 7.633006] bdi 252:0, work items left: 2
[ 12.913256] INFO: The task sync:275 has been waiting for writeback completion for more than 10 seconds.
[ 12.913263] bdi 252:0, work items left: 2
[ 18.353245] INFO: The task sync:275 has been waiting for writeback completion for more than 16 seconds.
[ 18.353252] bdi 252:0, work items left: 2
[ 23.633304] INFO: The task sync:275 has been waiting for writeback completion for more than 21 seconds.
[ 23.633312] bdi 252:0, work items left: 2
[ 28.893299] INFO: The task sync:275 has been waiting for writeback completion for more than 26 seconds.
[ 28.893307] bdi 252:0, work items left: 2
[ 31.792987] The task sync:275 waited 29 seconds for writeback completion on bdi 252:0
Without patch 4, the same test logs 18 reports.
One question I left open: the report uses pr_info(). The hung task
warning these waiters used to trigger uses pr_err(), which still reaches
the consoles, netconsole included, with "quiet" on the command line
(console loglevel 4). The report does not, and pr_warn() would not
either. Should it be pr_err()?
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Breno Leitao (4):
writeback: add the missing newline to the slow writeback report
writeback: name the bdi in the slow writeback report
writeback: log the end of a slow writeback wait
writeback: report a slow writeback wait once per timeout
fs/fs-writeback.c | 37 ++++++++++++++++++++++++++++---------
include/linux/backing-dev-defs.h | 1 +
include/linux/backing-dev.h | 3 ++-
mm/memcontrol.c | 2 +-
4 files changed, 32 insertions(+), 11 deletions(-)
---
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
change-id: 20261105-writeback_stall_report-170750a69946
Best regards,
--
Breno Leitao <leitao@debian.org>
next reply other threads:[~2026-11-06 12:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 12:26 Breno Leitao [this message]
2026-11-06 12:26 ` [PATCH 1/4] writeback: add the missing newline to the slow writeback report Breno Leitao
2026-11-06 14:18 ` Jan Kara
2026-11-06 12:26 ` [PATCH 2/4] writeback: name the bdi in " Breno Leitao
2026-11-06 14:27 ` Jan Kara
2026-11-06 15:48 ` Breno Leitao
2026-11-06 12:26 ` [PATCH 3/4] writeback: log the end of a slow writeback wait Breno Leitao
2026-11-06 14:29 ` Jan Kara
2026-11-06 12:26 ` [PATCH 4/4] writeback: report a slow writeback wait once per timeout Breno Leitao
2026-11-06 14:37 ` Jan Kara
2026-11-06 15:47 ` Breno Leitao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261106-writeback_stall_report-v1-0-bf0c3b9023a5@debian.org \
--to=leitao@debian.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=kernel-team@meta.com \
--cc=liam@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
--cc=sunjunchao@bytedance.com \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®