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]
Date:	Fri, 30 Jan 2009 19:25:14 -0800
From:	Davide Libenzi <davidel@...ilserver.org>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Ingo Molnar <mingo@...e.hu>, David Miller <davem@...emloft.net>
Subject: [patch 3/7] epoll keyed wakeups - introduce key-aware wakeup macros

The following patch introduces new kwake_* macros that accepts an
extra key parameter to be specified in the wakeup.
I chose to add an initial 'k' to the original names, instead of adding
a whole "_key", since the name of some of those macros is becoming
awfully long. No problem in using the "_key" naming, if others feel it.
Comments?



Signed-off-by: Davide Libenzi <davidel@...ilserver.org>


- Davide


---
 include/linux/wait.h |   41 +++++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 12 deletions(-)

Index: linux-2.6.mod/include/linux/wait.h
===================================================================
--- linux-2.6.mod.orig/include/linux/wait.h	2009-01-30 12:11:42.000000000 -0800
+++ linux-2.6.mod/include/linux/wait.h	2009-01-30 12:11:44.000000000 -0800
@@ -144,31 +144,48 @@ int out_of_line_wait_on_bit(void *, int,
 int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned);
 wait_queue_head_t *bit_waitqueue(void *, int);
 
-#define wake_up(x)			__wake_up(x, TASK_NORMAL, 1, NULL)
-#define wake_up_nr(x, nr)		__wake_up(x, TASK_NORMAL, nr, NULL)
-#define wake_up_all(x)			__wake_up(x, TASK_NORMAL, 0, NULL)
-#define wake_up_locked(x)		__wake_up_locked((x), TASK_NORMAL, NULL)
-
-#define wake_up_interruptible(x)	__wake_up(x, TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_interruptible_nr(x, nr)	__wake_up(x, TASK_INTERRUPTIBLE, nr, NULL)
-#define wake_up_interruptible_all(x)	__wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
-#define wake_up_interruptible_sync(x)	__wake_up_sync((x), TASK_INTERRUPTIBLE, 1, \
-						       NULL)
+#define kwake_up(x, k)			__wake_up(x, TASK_NORMAL, 1, (void *) (k))
+#define kwake_up_nr(x, nr, k)		__wake_up(x, TASK_NORMAL, nr, (void *) (k))
+#define kwake_up_all(x, k)		__wake_up(x, TASK_NORMAL, 0, (void *) (k))
+#define kwake_up_locked(x, k)		__wake_up_locked((x), TASK_NORMAL, \
+						(void *) (k))
+
+#define kwake_up_interruptible(x, k)	__wake_up(x, TASK_INTERRUPTIBLE, 1, \
+						(void *) (k))
+#define kwake_up_interruptible_nr(x, nr, k)	__wake_up(x, TASK_INTERRUPTIBLE, nr, \
+						(void *) (k))
+#define kwake_up_interruptible_all(x, k)	__wake_up(x, TASK_INTERRUPTIBLE, 0, \
+						(void *) (k))
+#define kwake_up_interruptible_sync(x, k)	__wake_up_sync((x), TASK_INTERRUPTIBLE, \
+						1, (void *) (k))
+
+#define wake_up(x)			kwake_up(x, NULL)
+#define wake_up_nr(x, nr)		kwake_up_nr(x, nr, NULL)
+#define wake_up_all(x)			kwake_up_all(x, NULL)
+#define wake_up_locked(x)		kwake_up_locked(x, NULL)
+
+#define wake_up_interruptible(x)	kwake_up_interruptible(x, NULL)
+#define wake_up_interruptible_nr(x, nr)	kwake_up_interruptible_nr(x, nr, NULL)
+#define wake_up_interruptible_all(x)	kwake_up_interruptible_all(x, NULL)
+#define wake_up_interruptible_sync(x)	kwake_up_interruptible_sync(x, NULL)
+
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 /*
  * macro to avoid include hell
  */
-#define wake_up_nested(x, s)						\
+#define kwake_up_nested(x, s, k)					\
 do {									\
 	unsigned long flags;						\
 									\
 	spin_lock_irqsave_nested(&(x)->lock, flags, (s));		\
-	wake_up_locked(x); 						\
+	kwake_up_locked(x, k); 						\
 	spin_unlock_irqrestore(&(x)->lock, flags);			\
 } while (0)
+#define wake_up_nested(x, s)		kwake_up_nested(x, s, NULL)
 #else
 #define wake_up_nested(x, s)		wake_up(x)
+#define kwake_up_nested(x, k, s)	kwake_up(x, k)
 #endif
 
 #define __wait_event(wq, 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