[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <483E80AB020000C70003891C@lucius.provo.novell.com>
Date: Thu, 29 May 2008 10:08:43 -0600
From: "Patrick Mullaney" <pmullaney@...ell.com>
To: <davem@...emloft.net>
Cc: "Gregory Haskins" <GHaskins@...ell.com>, <netdev@...r.kernel.org>
Subject: [PATCH] net/core/sock.c remove extra wakeup
From: Patrick Mullaney <pmullaney@...ell.com>
We have noticed an extra wakeup of a task waiting on a udp receive
while testing with CONFIG_PREEMPT_RT. The following patch
eliminates the source of the extra wakeup by only waking a task
if it is waiting on the writable condition(the SOCK_NOSPACE
bit has been set). The patch is against 2.6.25.
Signed-off-by: Patrick Mullaney <pmullaney@...ell.com>
---
net/core/sock.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index 7a0567b..df08fb2 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1628,12 +1628,17 @@ static void sock_def_readable(struct sock *sk, int len)
static void sock_def_write_space(struct sock *sk)
{
+ /* don't wake unless writer is waiting */
+ if(!test_bit(SOCK_NOSPACE, &sk->sk_socket->flags))
+ return;
+
read_lock(&sk->sk_callback_lock);
/* Do not wake up a writer until he can make "significant"
* progress. --DaveM
*/
if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
+ clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
wake_up_interruptible_sync(sk->sk_sleep);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists