From: Davide Libenzi <davidel@xmailserver.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>, Ingo Molnar <mingo@elte.hu>,
David Miller <davem@davemloft.net>
Subject: [patch 2/6] epoll keyed wakeups v2 - introduce new *_poll() wakeup macros
Date: Sun, 01 Feb 2009 12:04:23 -0800 [thread overview]
Message-ID: <send-serie.davidel@xmailserver.org.13601.1233518664.2> (raw)
This patch introduces new wakeup macros that allow passing an event
mask to the wakeup targets. They exactly mimic their non-_poll()
counterpart, with the added event mask passing capability.
I did add only the ones currently requested, avoiding the _nr() and
_all() for the moment.
Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
- Davide
---
include/linux/wait.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
Index: linux-2.6.mod/include/linux/wait.h
===================================================================
--- linux-2.6.mod.orig/include/linux/wait.h 2009-01-31 15:24:50.000000000 -0800
+++ linux-2.6.mod/include/linux/wait.h 2009-01-31 15:33:40.000000000 -0800
@@ -156,6 +156,18 @@ wait_queue_head_t *bit_waitqueue(void *,
#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)
+/*
+ * Wakeup macros to be used to report events to the targets.
+ */
+#define wake_up_poll(x, m) \
+ __wake_up(x, TASK_NORMAL, 1, (void *) (m))
+#define wake_up_locked_poll(x, m) \
+ __wake_up_locked_key((x), TASK_NORMAL, (void *) (m))
+#define wake_up_interruptible_poll(x, m) \
+ __wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m))
+#define wake_up_interruptible_sync_poll(x, m) \
+ __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, (void *) (m))
+
#ifdef CONFIG_DEBUG_LOCK_ALLOC
/*
* macro to avoid include hell
@@ -168,8 +180,17 @@ do { \
wake_up_locked(x); \
spin_unlock_irqrestore(&(x)->lock, flags); \
} while (0)
+#define wake_up_nested_poll(x, m, s) \
+do { \
+ unsigned long flags; \
+ \
+ spin_lock_irqsave_nested(&(x)->lock, flags, (s)); \
+ wake_up_locked_poll(x, m); \
+ spin_unlock_irqrestore(&(x)->lock, flags); \
+} while (0)
#else
#define wake_up_nested(x, s) wake_up(x)
+#define wake_up_nested_poll(x, m, s) wake_up_poll(x, m)
#endif
#define __wait_event(wq, condition) \
next reply other threads:[~2009-02-01 20:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-01 20:04 Davide Libenzi [this message]
2009-02-03 8:14 ` [patch 2/6] epoll keyed wakeups v2 - introduce new *_poll() wakeup macros Andrew Morton
2009-02-03 18:24 ` Davide Libenzi
2009-02-03 19:20 ` Davide Libenzi
2009-02-03 20:10 ` Andrew Morton
2009-02-03 20:24 ` Davide Libenzi
2009-02-03 20:28 ` Linus Torvalds
2009-02-03 20:34 ` Davide Libenzi
2009-02-03 20:53 ` Linus Torvalds
2009-02-03 18:28 ` Davide Libenzi
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=send-serie.davidel@xmailserver.org.13601.1233518664.2 \
--to=davidel@xmailserver.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.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