public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Haotian Zhang <vulab@iscas.ac.cn>
Cc: Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dm log-writes: Add missing set_freezable() for freezable kthread
Date: Tue, 2 Dec 2025 13:50:28 -0500	[thread overview]
Message-ID: <aS809CQLuXlyCcv6@redhat.com> (raw)
In-Reply-To: <20251201074103.1281-1-vulab@iscas.ac.cn>

On Mon, Dec 01, 2025 at 03:41:03PM +0800, Haotian Zhang wrote:
> The log_writes_kthread() calls try_to_freeze() but lacks set_freezable(),
> rendering the freeze attempt ineffective since kernel threads are
> non-freezable by default. This prevents proper thread suspension during
> system suspend/hibernate.
> 
> Add set_freezable() to explicitly mark the thread as freezable.
> 

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> Fixes: 0e9cebe72459 ("dm: add log writes target")
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
>  drivers/md/dm-log-writes.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c
> index 679b07dee229..1f8fbc27a12f 100644
> --- a/drivers/md/dm-log-writes.c
> +++ b/drivers/md/dm-log-writes.c
> @@ -432,6 +432,7 @@ static int log_writes_kthread(void *arg)
>  	struct log_writes_c *lc = arg;
>  	sector_t sector = 0;
>  
> +	set_freezable();
>  	while (!kthread_should_stop()) {
>  		bool super = false;
>  		bool logging_enabled;
> -- 
> 2.50.1.windows.1
> 


      reply	other threads:[~2025-12-02 18:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01  7:41 [PATCH] dm log-writes: Add missing set_freezable() for freezable kthread Haotian Zhang
2025-12-02 18:50 ` Benjamin Marzinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aS809CQLuXlyCcv6@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    --cc=vulab@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox