Re: [PATCH 1/2] jbd2: check need_resched() when skipping busy checkpoint buffers

Max Kellermann <[email protected]>
Newsgroups org.kernel.vger.linux-ext4,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CAKPOu+-ATGd8A_CeO1bW2A2sN3K_cbcimwHO5M-HY-AChsOmuA@mail.gmail.com>
On Thu, Jul 16, 2026 at 10:04 PM Andreas Dilger <[email protected]> wrote:
> One question I had about this patch is whether the list cleanup could get
> into a livelock if it becomes too large?

It was a livelock *without* this patch, because all CPUs were busy
inside this piece of shrinker code; one of them holding j_list_lock,
all others spinning on that very spinlock (all CPUs busy), and actal
I/O was stalled seemingly forever.

> If the iterator is processing
> a large number of jh that cannot be freed, then `need_resched()` is hit,
> if it restarts from the beginning of the list each time without processing
> at least one jh it will not make forward progress.

If no progress is made, then this shrinker call just wasn't able to
free anything. That was the behavior before b98dba273a0e ("jbd2:
remove journal_clean_one_cp_list()") and my patch restores this
behavior. It's not a problem. It's faily normal for shrinkers to not
be able to free anything.

-- 
Max Kellermann
Principal Architect
Hosting Technology

cm4all | Im Mediapark 6a | 50670 Köln | Germany
General information about the company can be found here:
https://www.cm4all.com/impressum
A member of the IONOS Group
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.