netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Per Liden <per.liden@ericsson.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Allan Stephens <allan.stephens@windriver.com>
Subject: [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes
Date: Fri, 13 Oct 2006 13:37:46 +0200	[thread overview]
Message-ID: <11607394752213-git-send-email-per.liden@ericsson.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0610131330350.30166@ulinpc219.uab.ericsson.se>

From: Allan Stephens <allan.stephens@windriver.com>

This patch adds a simple test so TIPC doesn't try waking up processes
waiting on a socket if there are none waiting.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
 net/tipc/socket.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ed900fe..2a6a5a6 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1208,7 +1208,8 @@ static u32 dispatch(struct tipc_port *tp
 	atomic_inc(&tipc_queue_size);
 	skb_queue_tail(&sock->sk->sk_receive_queue, buf);
 
-        wake_up_interruptible(sock->sk->sk_sleep);
+	if (waitqueue_active(sock->sk->sk_sleep))
+		wake_up_interruptible(sock->sk->sk_sleep);
 	return TIPC_OK;
 }
 
@@ -1223,7 +1224,8 @@ static void wakeupdispatch(struct tipc_p
 {
 	struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle;
 
-        wake_up_interruptible(tsock->sk.sk_sleep);
+	if (waitqueue_active(tsock->sk.sk_sleep))
+		wake_up_interruptible(tsock->sk.sk_sleep);
 }
 
 /**
-- 
1.4.1


  parent reply	other threads:[~2006-10-13 11:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
2006-10-13 11:37 ` [PATCH 1/14] [TIPC] Add missing unlock in port timeout code Per Liden
2006-10-17  4:39   ` David Miller
2006-10-13 11:37 ` [PATCH 2/14] [TIPC] Debug print buffer enhancements and fixes Per Liden
2006-10-17  4:43   ` David Miller
2006-10-13 11:37 ` [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time Per Liden
2006-10-17  4:44   ` David Miller
2006-10-13 11:37 ` [PATCH 4/14] [TIPC] Added duplicate node address detection capability Per Liden
2006-10-17  4:45   ` David Miller
2006-10-13 11:37 ` Per Liden [this message]
2006-10-17  4:48   ` [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes David Miller
2006-10-13 11:37 ` [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework Per Liden
2006-10-17  4:49   ` David Miller
2006-10-13 11:37 ` [PATCH 7/14] [TIPC] Add support for Ethernet VLANs Per Liden
2006-10-17  4:50   ` David Miller
2006-10-13 11:37 ` [PATCH 8/14] [TIPC] Fix socket receive queue NULL pointer dereference on SMP systems Per Liden
2006-10-17  4:55   ` David Miller
2006-10-13 11:37 ` [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order Per Liden
2006-10-13 23:13   ` Bill Fink
2006-10-16  8:50     ` Per Liden
2006-10-16 20:59       ` David Miller
2006-10-17  4:56   ` David Miller
2006-10-13 11:37 ` [PATCH 10/14] [TIPC] Fixed slow link reactivation when link tolerance is large Per Liden
2006-10-17  4:57   ` David Miller
2006-10-13 11:37 ` [PATCH 11/14] [TIPC] Can now list multicast link on an isolated network node Per Liden
2006-10-17  4:58   ` David Miller
2006-10-13 11:37 ` [PATCH 12/14] [TIPC] Added subscription cancellation capability Per Liden
2006-10-17  5:00   ` David Miller
2006-10-13 11:37 ` [PATCH 13/14] [TIPC] Unrecognized configuration command now returns error message Per Liden
2006-10-17  5:01   ` David Miller
2006-10-13 11:37 ` [PATCH 14/14] [TIPC] Updated TIPC version number to 1.6.2 Per Liden
2006-10-17  5:01   ` David Miller
2006-10-17  5:04 ` [PATCH 0/14] TIPC updates David Miller
2006-10-18  8:24   ` Per Liden

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=11607394752213-git-send-email-per.liden@ericsson.com \
    --to=per.liden@ericsson.com \
    --cc=allan.stephens@windriver.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).