lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260121194333.GO166857@noisy.programming.kicks-ass.net>
Date: Wed, 21 Jan 2026 20:43:33 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Remi Pommarel <repk@...plefau.lt>
Cc: Ingo Molnar <mingo@...hat.com>, v9fs@...ts.linux.dev,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Eric Van Hensbergen <ericvh@...nel.org>,
	Latchesar Ionkov <lucho@...kov.net>,
	Dominique Martinet <asmadeus@...ewreck.org>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] wait: Introduce io_wait_event_killable()

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@...plefau.lt>

Acked-by: Peter Zijlstra (Intel) <peterz@...radead.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ