Re: [PATCH 1/2] jbd2: check need_resched() when skipping busy checkpoint buffers
From: Max Kellermann
Date: Fri Jul 17 2026 - 01:47:44 EST
On Thu, Jul 16, 2026 at 10:04 PM Andreas Dilger <adilger@xxxxxxxxx> 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