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-next>] [day] [month] [year] [list]
Message-ID: <20250609030759.3576335-1-senozhatsky@chromium.org>
Date: Mon,  9 Jun 2025 12:07:36 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Miklos Szeredi <miklos@...redi.hu>,
	Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>,
	Tomasz Figa <tfiga@...omium.org>,
	linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: [PATCH 1/2] wait: add wait_event_freezable_killable_exclusive

Add a freezable variant of exclusive wait.  This can be useful
in, for example, FUSE when system suspend occurs while FUSE is
blocked on requests (which prevents system suspend.)

Signed-off-by: Sergey Senozhatsky <senozhatsky@...omium.org>
---
 include/linux/wait.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 327894f022cf..b98cfd094543 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -657,6 +657,20 @@ do {										\
 	__ret;									\
 })
 
+#define __wait_event_freezable_killable_exclusive(wq, condition)		\
+	___wait_event(wq, condition, (TASK_KILLABLE|TASK_FREEZABLE), 1, 0,	\
+		      schedule())
+
+#define wait_event_freezable_killable_exclusive(wq, condition)			\
+({										\
+	int __ret = 0;								\
+	might_sleep();								\
+	if (!(condition))							\
+		__ret = __wait_event_freezable_killable_exclusive(wq,		\
+								  condition);	\
+	__ret;									\
+})
+
 /**
  * wait_event_idle - wait for a condition without contributing to system load
  * @wq_head: the waitqueue to wait on
-- 
2.50.0.rc1.591.g9c95f17f64-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ