From: Andreas Gruenbacher <agruenba@redhat.com>
To: Kevin Hao <haokexin@gmail.com>
Cc: gfs2@lists.linux.dev, "Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH 1/2] gfs2: Add missing set_freezable() for freezable kthread
Date: Thu, 21 Dec 2023 15:10:15 +0100 [thread overview]
Message-ID: <CAHc6FU7DJkL68oD5we35mgO7fOAptmy1G=d3XrgHjBpWSWaVGQ@mail.gmail.com> (raw)
In-Reply-To: <20231218053558.1200822-1-haokexin@gmail.com>
Kevin,
On Mon, Dec 18, 2023 at 6:36 AM Kevin Hao <haokexin@gmail.com> wrote:
> The kernel thread function gfs2_logd() and gfs2_quotad() invoke the
> try_to_freeze() in its loop. But all the kernel threads are no-freezable
> by default. So if we want to make a kernel thread to be freezable,
> we have to invoke set_freezable() explicitly.
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
> fs/gfs2/log.c | 1 +
> fs/gfs2/quota.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
> index e5271ae87d1c..a268b69bb636 100644
> --- a/fs/gfs2/log.c
> +++ b/fs/gfs2/log.c
> @@ -1297,6 +1297,7 @@ int gfs2_logd(void *data)
> struct gfs2_sbd *sdp = data;
> unsigned long t = 1;
>
> + set_freezable();
> while (!kthread_should_stop()) {
> if (gfs2_withdrawn(sdp))
> break;
> diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
> index fa47824acf13..173581736a6e 100644
> --- a/fs/gfs2/quota.c
> +++ b/fs/gfs2/quota.c
> @@ -1583,6 +1583,7 @@ int gfs2_quotad(void *data)
> unsigned long quotad_timeo = 0;
> unsigned long t = 0;
>
> + set_freezable();
> while (!kthread_should_stop()) {
> if (gfs2_withdrawn(sdp))
> break;
> --
> 2.39.2
>
This is looking good, thank you. I've applied it to our for-next branch.
Andreas
prev parent reply other threads:[~2023-12-21 14:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 5:35 [PATCH 1/2] gfs2: Add missing set_freezable() for freezable kthread Kevin Hao
2023-12-18 5:35 ` [PATCH 2/2] gfs2: Use wait_event_freezable_timeout() " Kevin Hao
2023-12-21 14:11 ` Andreas Gruenbacher
2023-12-21 14:10 ` Andreas Gruenbacher [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='CAHc6FU7DJkL68oD5we35mgO7fOAptmy1G=d3XrgHjBpWSWaVGQ@mail.gmail.com' \
--to=agruenba@redhat.com \
--cc=gfs2@lists.linux.dev \
--cc=haokexin@gmail.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).