netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: davem@davemloft.net
Cc: allan.stephens@windriver.com, netdev@vger.kernel.org,
	Allan Stephens <Allan.Stephens@windriver.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH net-next 10/17] tipc: Improve accuracy of link transmit queue maximum size statistic
Date: Wed, 23 Feb 2011 20:26:38 -0500	[thread overview]
Message-ID: <1298510805-20630-11-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>

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

Enhances TIPC's unicast and broadcast link code to update the transmit
queue maximum size counter in a single place, namely the routine that
adds messages to the queue. This ensures that the maximum size statistic
reported for unicast links is completely accurate, rather than being
partially based on statistical sampling.

The changes to link.h are just documenting the roles of the variables.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/bcast.c |    2 --
 net/tipc/link.c  |    9 +++------
 net/tipc/link.h  |   18 ++++++------------
 3 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index a5eb7db..63df42b 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -418,8 +418,6 @@ int tipc_bclink_send_msg(struct sk_buff *buf)
 	else
 		bclink_set_last_sent();
 
-	if (bcl->out_queue_size > bcl->stats.max_queue_sz)
-		bcl->stats.max_queue_sz = bcl->out_queue_size;
 	bcl->stats.queue_sz_counts++;
 	bcl->stats.accu_queue_sz += bcl->out_queue_size;
 
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 0cb773b..d1818fb 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -246,9 +246,6 @@ static void link_timeout(struct link *l_ptr)
 	l_ptr->stats.accu_queue_sz += l_ptr->out_queue_size;
 	l_ptr->stats.queue_sz_counts++;
 
-	if (l_ptr->out_queue_size > l_ptr->stats.max_queue_sz)
-		l_ptr->stats.max_queue_sz = l_ptr->out_queue_size;
-
 	if (l_ptr->first_out) {
 		struct tipc_msg *msg = buf_msg(l_ptr->first_out);
 		u32 length = msg_size(msg);
@@ -824,7 +821,10 @@ static void link_add_to_outqueue(struct link *l_ptr,
 		l_ptr->last_out = buf;
 	} else
 		l_ptr->first_out = l_ptr->last_out = buf;
+
 	l_ptr->out_queue_size++;
+	if (l_ptr->out_queue_size > l_ptr->stats.max_queue_sz)
+		l_ptr->stats.max_queue_sz = l_ptr->out_queue_size;
 }
 
 /*
@@ -867,9 +867,6 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
 
 	/* Packet can be queued or sent: */
 
-	if (queue_size > l_ptr->stats.max_queue_sz)
-		l_ptr->stats.max_queue_sz = queue_size;
-
 	if (likely(!tipc_bearer_congested(l_ptr->b_ptr, l_ptr) &&
 		   !link_congested(l_ptr))) {
 		link_add_to_outqueue(l_ptr, buf, msg);
diff --git a/net/tipc/link.h b/net/tipc/link.h
index bdb0fa2..a7794e7 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -196,18 +196,12 @@ struct link {
 		u32 bearer_congs;
 		u32 deferred_recv;
 		u32 duplicates;
-
-		/* for statistical profiling of send queue size */
-
-		u32 max_queue_sz;
-		u32 accu_queue_sz;
-		u32 queue_sz_counts;
-
-		/* for statistical profiling of message lengths */
-
-		u32 msg_length_counts;
-		u32 msg_lengths_total;
-		u32 msg_length_profile[7];
+		u32 max_queue_sz;	/* send queue size high water mark */
+		u32 accu_queue_sz;	/* used for send queue size profiling */
+		u32 queue_sz_counts;	/* used for send queue size profiling */
+		u32 msg_length_counts;	/* used for message length profiling */
+		u32 msg_lengths_total;	/* used for message length profiling */
+		u32 msg_length_profile[7]; /* used for msg. length profiling */
 	} stats;
 };
 
-- 
1.7.3.3


  parent reply	other threads:[~2011-02-24  1:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24  1:26 [PATCH net-next 00/17] TIPC: Another mixed bag of cleanups and bugfixes Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 01/17] tipc: Combine port structure with tipc_port structure Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 02/17] tipc: Combine bearer structure with tipc_bearer structure Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 03/17] tipc: Remove unused global variable tipc_user_count Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 04/17] tipc: Prevent invalid memory access when sending to configuration service Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 05/17] tipc: Improve handling of invalid link tolerance values Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 06/17] tipc: Fix print statements that assume pointers are 32-bit values Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 07/17] tipc: Clean out all remaining instances of #if 0'd unused code Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 08/17] tipc: Clean up tracking of node requesting a broadcast retransmit Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 09/17] tipc: Eliminate unnecessary locking when starting topology service Paul Gortmaker
2011-02-24  1:26 ` Paul Gortmaker [this message]
2011-02-24  1:26 ` [PATCH net-next 11/17] tipc: Set unused probe field of link protocol messages to defined value Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 12/17] tipc: Minor optimization to topology service connection establishment Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 13/17] tipc: Fix port counter handling to correct congestion control Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 14/17] tipc: Add in missing lock during link initialization Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 15/17] tipc: Remove support for per-connection message sequence numbering Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 16/17] tipc: Remove unused message header field for requested number of links Paul Gortmaker
2011-02-24  1:26 ` [PATCH net-next 17/17] tipc: Avoid reliable broadcast preparation for NACK messages Paul Gortmaker
2011-02-24  4:49 ` [PATCH net-next 00/17] TIPC: Another mixed bag of cleanups and bugfixes David Miller

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=1298510805-20630-11-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.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).