From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel@redhat.com
Subject: [Cluster-devel] [PATCH 1/4] gfs2: Switch to wait_event in gfs2_logd
Date: Thu, 24 Aug 2023 23:10:58 +0200 [thread overview]
Message-ID: <20230824211101.3242346-2-agruenba@redhat.com> (raw)
In-Reply-To: <20230824211101.3242346-1-agruenba@redhat.com>
In gfs2_logd(), switch from an open-coded wait loop to
wait_event_interruptible_timeout().
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/log.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index aa568796207c..d3da259820e3 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -1301,7 +1301,6 @@ int gfs2_logd(void *data)
{
struct gfs2_sbd *sdp = data;
unsigned long t = 1;
- DEFINE_WAIT(wait);
while (!kthread_should_stop()) {
@@ -1338,17 +1337,11 @@ int gfs2_logd(void *data)
try_to_freeze();
- do {
- prepare_to_wait(&sdp->sd_logd_waitq, &wait,
- TASK_INTERRUPTIBLE);
- if (!gfs2_ail_flush_reqd(sdp) &&
- !gfs2_jrnl_flush_reqd(sdp) &&
- !kthread_should_stop())
- t = schedule_timeout(t);
- } while(t && !gfs2_ail_flush_reqd(sdp) &&
- !gfs2_jrnl_flush_reqd(sdp) &&
- !kthread_should_stop());
- finish_wait(&sdp->sd_logd_waitq, &wait);
+ t = wait_event_interruptible_timeout(sdp->sd_logd_waitq,
+ gfs2_ail_flush_reqd(sdp) ||
+ gfs2_jrnl_flush_reqd(sdp) ||
+ kthread_should_stop(),
+ t);
}
return 0;
--
2.40.1
next prev parent reply other threads:[~2023-08-24 21:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 21:10 [Cluster-devel] [PATCH 0/4] gfs2: logd cleanups on for-next Andreas Gruenbacher
2023-08-24 21:10 ` Andreas Gruenbacher [this message]
2023-08-24 21:10 ` [Cluster-devel] [PATCH 2/4] gfs2: low-memory forced flush fixes Andreas Gruenbacher
2023-08-24 21:11 ` [Cluster-devel] [PATCH 3/4] gfs2: Fix logd wakeup on I/O error Andreas Gruenbacher
2023-08-24 21:11 ` [Cluster-devel] [PATCH 4/4] gfs2: journal flush threshold fixes and cleanup Andreas Gruenbacher
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=20230824211101.3242346-2-agruenba@redhat.com \
--to=agruenba@redhat.com \
--cc=cluster-devel@redhat.com \
/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).