mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Remi Pommarel <repk@triplefau.lt>
Cc: Ingo Molnar <mingo@redhat.com>,
	v9fs@lists.linux.dev, 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
Subject: Re: [PATCH 1/2] wait: Introduce io_wait_event_killable()
Date: Wed, 21 Jan 2026 20:43:33 +0100	[thread overview]
Message-ID: <20260121194333.GO166857@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <1b2870001ecd34fe6c05be2ddfefb3c798b11701.1769009696.git.repk@triplefau.lt>

On Wed, Jan 21, 2026 at 08:21:58PM +0100, Remi Pommarel wrote:
> 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>

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

> ---
>  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
> 

  reply	other threads:[~2026-01-21 19:43 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 ` [PATCH 1/2] wait: Introduce io_wait_event_killable() Remi Pommarel
2026-01-21 19:43   ` Peter Zijlstra [this message]
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=20260121194333.GO166857@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --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=repk@triplefau.lt \
    --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®