Re: [PATCH 4/4] writeback: report a slow writeback wait once per timeout

From: Breno Leitao

Date: Mon Nov 09 2026 - 11:56:31 EST


Hello Jan,

On Mon, Nov 09, 2026 at 03:12:16PM +0100, Jan Kara wrote:
> > Once per timeout is also how often the hung task detector checks by
> > default, and patch 3 logs the total once the wait ends, so maybe that is
> > exactly what people need? Not sure.
>
> I was mostly making jokes here. I agree reporting once per hung-task
> timeout makes more sense.

you got me here. ;-P

> > > Is this change substantially different from
> > > writeback_sb_inodes() waking up done->waitq less frequently?
> >
> > You mean the ->progress_stamp field? That is not used for reporting
> > purposes, right? Should it be?
>
> So my thinking was: If we change the wake up condition in
> writeback_sb_inodes() to use HZ * timeout as a limit instead of HZ *
> timeout / 2, then we should get one report per timeout, shouldn't we?

I think so. Let me hack it up and respin.

> > It could drop the duplicates: a wakeup with work left runs the
> > wait_event() condition twice (since 84654c7f4730, it is checked right
> > after schedule() and again after prepare_to_wait_event()), and the
> > second check would find ->progress_stamp just refreshed by the first.
> >
> > But the waiter refreshes ->progress_stamp on every wakeup, so it cannot
> > space the reports further apart than the wakeups, and those have to
> > come more often than the hung task timeout.
>
> Why do we want to wake up more often than hung task timeout? We evaluate
> the condition after each inode so the error shouldn't be that big?

Yeah, I don't think we want to wake up more often than the hung task
timeout. That should be enough here, honestly.

Thanks for the review,
--breno