Re: [PATCH 1/6] zram: cond_resched() in writeback loop
From: Andrew Morton
Date: Tue Dec 10 2024 - 19:55:03 EST
On Tue, 10 Dec 2024 19:53:55 +0900 Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> wrote:
> Writeback loop can run for quite a while (depending on
> wb device performance, compression algorithm and the
> number of entries we writeback), so we need to do
> cond_resched() there, similarly to what we do in
> recompress loop.
>
> ...
>
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -889,6 +889,8 @@ static ssize_t writeback_store(struct device *dev,
> next:
> zram_slot_unlock(zram, index);
> release_pp_slot(zram, pps);
> +
> + cond_resched();
> }
>
> if (blk_idx)
Should this be treated as a hotfix? With a -stable backport?
If so, we'd need to explain our reasoning in the changelog. "Fixes a
watchdog lockup splat when running <workload>". And a Fixes: would be
nice if appropriate.