From: Remi Pommarel <repk@triplefau.lt>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
v9fs@lists.linux.dev
Cc: Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Eric Van Hensbergen <ericvh@kernel.org>,
Latchesar Ionkov <lucho@ionkov.net>,
Dominique Martinet <asmadeus@codewreck.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Remi Pommarel <repk@triplefau.lt>
Subject: [PATCH 1/2] wait: Introduce io_wait_event_killable()
Date: Wed, 21 Jan 2026 20:21:58 +0100 [thread overview]
Message-ID: <1b2870001ecd34fe6c05be2ddfefb3c798b11701.1769009696.git.repk@triplefau.lt> (raw)
In-Reply-To: <cover.1769009696.git.repk@triplefau.lt>
Add io_wait_event_killable(), a variant of wait_event_killable() that
uses io_schedule() instead of schedule(). This is to be used in
situation where waiting time is to be accounted as IO wait time.
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
include/linux/wait.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index f648044466d5..dce055e6add3 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -937,6 +937,21 @@ extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_entry_t *);
__ret; \
})
+#define __io_wait_event_killable(wq, condition) \
+ ___wait_event(wq, condition, TASK_KILLABLE, 0, 0, io_schedule())
+
+/*
+ * wait_event_killable() - link wait_event_killable but with io_schedule()
+ */
+#define io_wait_event_killable(wq_head, condition) \
+({ \
+ int __ret = 0; \
+ might_sleep(); \
+ if (!(condition)) \
+ __ret = __io_wait_event_killable(wq_head, condition); \
+ __ret; \
+})
+
#define __wait_event_state(wq, condition, state) \
___wait_event(wq, condition, state, 0, 0, schedule())
--
2.50.1
next prev parent reply other threads:[~2026-01-21 19:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 19:21 [PATCH 0/2] wait/9p: Account 9P RPC waiting time as I/O wait Remi Pommarel
2026-01-21 19:21 ` Remi Pommarel [this message]
2026-01-21 19:43 ` [PATCH 1/2] wait: Introduce io_wait_event_killable() Peter Zijlstra
2026-01-21 19:21 ` [PATCH 2/2] 9p: Track 9P RPC waiting time as IO Remi Pommarel
2026-01-21 23:20 ` Dominique Martinet
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=1b2870001ecd34fe6c05be2ddfefb3c798b11701.1769009696.git.repk@triplefau.lt \
--to=repk@triplefau.lt \
--cc=asmadeus@codewreck.org \
--cc=ericvh@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=v9fs@lists.linux.dev \
--cc=vincent.guittot@linaro.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
all inboxes | Powered by JetHome®