* [patch 3/6] epoll keyed wakeups v2 - make sockets use keyed wakeups
@ 2009-02-01 20:04 Davide Libenzi
0 siblings, 0 replies; only message in thread
From: Davide Libenzi @ 2009-02-01 20:04 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: Andrew Morton, Linus Torvalds, Alan Cox, Ingo Molnar, David Miller
The following patch adds support for event-aware wakeups to
the sockets code. Events are delivered to the wakeup target,
so that epoll can avoid spurious wakeups for non-interesting
events.
Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
- Davide
---
net/core/sock.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: linux-2.6.mod/net/core/sock.c
===================================================================
--- linux-2.6.mod.orig/net/core/sock.c 2009-01-31 14:55:13.000000000 -0800
+++ linux-2.6.mod/net/core/sock.c 2009-01-31 15:34:41.000000000 -0800
@@ -1628,7 +1628,7 @@ static void sock_def_error_report(struct
{
read_lock(&sk->sk_callback_lock);
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
- wake_up_interruptible(sk->sk_sleep);
+ wake_up_interruptible_poll(sk->sk_sleep, POLLERR);
sk_wake_async(sk, SOCK_WAKE_IO, POLL_ERR);
read_unlock(&sk->sk_callback_lock);
}
@@ -1637,7 +1637,7 @@ static void sock_def_readable(struct soc
{
read_lock(&sk->sk_callback_lock);
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
- wake_up_interruptible_sync(sk->sk_sleep);
+ wake_up_interruptible_sync_poll(sk->sk_sleep, POLLIN);
sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
read_unlock(&sk->sk_callback_lock);
}
@@ -1651,7 +1651,7 @@ static void sock_def_write_space(struct
*/
if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
- wake_up_interruptible_sync(sk->sk_sleep);
+ wake_up_interruptible_sync_poll(sk->sk_sleep, POLLOUT);
/* Should agree with poll, otherwise some programs break */
if (sock_writeable(sk))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-01 20:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-01 20:04 [patch 3/6] epoll keyed wakeups v2 - make sockets use keyed wakeups Davide Libenzi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®