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: <20141031174114.GO10501@worktop.programming.kicks-ass.net>
Date:	Fri, 31 Oct 2014 18:41:14 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	mingo@...nel.org, linux-kernel@...r.kernel.org
Cc:	peter@...leysoftware.com, oleg@...hat.com, rjw@...ysocki.net,
	torvalds@...ux-foundation.org, tglx@...utronix.de,
	eparis@...hat.com, umgwanakikbuti@...il.com, marcel@...tmann.org,
	ebiederm@...ssion.com, davem@...emloft.net, fengguang.wu@...el.com
Subject: Re: [PATCH 2/7] wait: Reimplement wait_event_freezable()

On Fri, Oct 31, 2014 at 12:10:39PM +0100, Peter Zijlstra wrote:
> Provide better implementations of wait_event_freezable() APIs.
> 
> The problem is with freezer_do_not_count(), it hides the thread from
> the freezer, even though this thread might not actually freeze/sleep
> at all.
> 
> Cc: oleg@...hat.com
> Cc: Rafael Wysocki <rjw@...ysocki.net>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---

This would maybe compile better.. gotta run, will test later.

--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -284,12 +284,13 @@ do {									\
  * change the result of the wait condition.
  */
 #define wait_event_freezable(wq, condition)				\
-do {									\
+({									\
+	int __ret = 0;							\
 	might_sleep();							\
-	if (condition)							\
-		break;							\
-	__wait_event_freezable(wq, condition);				\
-} while (0)
+	if (!(condition))						\
+		__ret = __wait_event_freezable(wq, condition);		\
+	__ret;								\
+})
 
 #define __wait_event_timeout(wq, condition, timeout)			\
 	___wait_event(wq, ___wait_cond_timeout(condition),		\
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ