Re: [PATCH 2/4] jbd2: make kjournald2 commit wait freezable

From: Jan Kara

Date: Sat May 30 2026 - 05:56:30 EST


On Wed 27-05-26 14:49:10, Dai Junbing wrote:
> While waiting for commit work, kjournald2 may be woken during suspend
> and resume due to freezer state transitions. This causes avoidable CPU
> activity in the suspend/resume path and adds unnecessary power overhead.
>
> Make the commit wait freezable so the thread is not unnecessarily woken
> by the freezer during suspend/resume.
>
> Signed-off-by: Dai Junbing <daijunbing@xxxxxxxx>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

Honza

> ---
> fs/jbd2/journal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index 4f397fcdb13c..d7ffe60c8793 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -222,7 +222,7 @@ static int kjournald2(void *arg)
> DEFINE_WAIT(wait);
>
> prepare_to_wait(&journal->j_wait_commit, &wait,
> - TASK_INTERRUPTIBLE);
> + TASK_INTERRUPTIBLE|TASK_FREEZABLE);
> transaction = journal->j_running_transaction;
> if (transaction == NULL ||
> time_before(jiffies, transaction->t_expires)) {
> --
> 2.25.1
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR