[netperf-dev] netperf2 commit notice r434 - trunk/src
raj at netperf.org
raj at netperf.org
Fri Jul 15 15:49:13 PDT 2011
Author: raj
Date: 2011-07-15 15:49:13 -0700 (Fri, 15 Jul 2011)
New Revision: 434
Modified:
trunk/src/netlib.c
trunk/src/nettest_omni.c
Log:
Close, hopefully, a race between netserver's results response and the
end of test timer when --enable-intervals are used and the RTT between
netperf and netserver is greater than the time remaining after the
last interval timer signal and when the alarm() signal will
arrive. Otherwise, the calls to retrieve the response may fail with an
EINTR.
Also, make the growth of request_cwnd a bit more conservative in first
burst mode by making it increase by one for every request_cwnd
transactions completed rather than by one for every transaction
completed. This is intended to make it less likely that multiple
small transactions will be condensed into the same transport segment
thanks to the transport congestion control.
For those who feel this is too conservative, specifying a negative
value for the first_burst_size via the test-specific -b option from
--enable-burst will cause the request_cwnd to be fully open from the
very start.
Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c 2011-07-14 19:08:48 UTC (rev 433)
+++ trunk/src/netlib.c 2011-07-15 22:49:13 UTC (rev 434)
@@ -919,6 +919,10 @@
times_up = 1;
#if defined(WANT_INTERVALS) && !defined(WANT_SPIN)
stop_itimer();
+ /* we should also stop the normal test timer lest it fire at an
+ inopportune moment - we do not know if we got here off the
+ interval timer or the test timer... */
+ stop_timer();
#endif /* WANT_INTERVALS */
break;
}
@@ -3364,28 +3368,28 @@
identify_remote()
{
-char *remote_id="";
-
-/* send a request for node info to the remote */
-netperf_request.content.request_type = NODE_IDENTIFY;
-
-send_request();
-
-/* and now wait for the reply to come back */
-
-recv_response();
-
-if (netperf_response.content.serv_errno) {
- Set_errno(netperf_response.content.serv_errno);
- perror("identify_remote: on remote");
- exit(1);
-}
-
-fprintf(where,"Remote Information \n\
+ char *remote_id="";
+
+ /* send a request for node info to the remote */
+ netperf_request.content.request_type = NODE_IDENTIFY;
+
+ send_request();
+
+ /* and now wait for the reply to come back */
+
+ recv_response();
+
+ if (netperf_response.content.serv_errno) {
+ Set_errno(netperf_response.content.serv_errno);
+ perror("identify_remote: on remote");
+ exit(1);
+ }
+
+ fprintf(where,"Remote Information \n\
Sysname Nodename Release Version Machine\n");
-
-fprintf(where,"%s",
- remote_id);
+
+ fprintf(where,"%s",
+ remote_id);
}
void
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2011-07-14 19:08:48 UTC (rev 433)
+++ trunk/src/nettest_omni.c 2011-07-15 22:49:13 UTC (rev 434)
@@ -4669,6 +4669,8 @@
happen that frankly, we cannot guarantee with the specification
of TCP. ain't that grand?-) raj 2006-01-30 */
int requests_outstanding = 0;
+ int requests_this_cwnd = 0;
+ int request_cwnd_initial = REQUEST_CWND_INITIAL;
int request_cwnd = REQUEST_CWND_INITIAL; /* we ass-u-me that having
three requests
outstanding at the
@@ -4680,6 +4682,18 @@
the third from our
regularly scheduled
send */
+
+ /* if the user has specified a negative value for first_burst_size
+ via the test-specific -b option, we forgo the nicities of ramping
+ up the request_cwnd and go straight to burst size. raj 20110715 */
+ if (first_burst_size < 0) {
+ first_burst_size = first_burst_size * -1;
+ request_cwnd_initial = first_burst_size;
+ }
+ else {
+ request_cwnd_initial = REQUEST_CWND_INITIAL;
+ }
+
#endif
omni_request =
@@ -4698,7 +4712,7 @@
if (!no_control) {
get_remote_system_info();
}
-
+
if (keep_histogram) {
if (first_burst_size > 0)
time_hist = HIST_new_n(first_burst_size + 1);
@@ -4772,9 +4786,10 @@
#ifdef WANT_FIRST_BURST
/* we have to remember to reset the number of transactions
outstanding and the "congestion window for each new
- iteration. raj 2006-01-31 */
+ iteration. raj 2006-01-31. */
requests_outstanding = 0;
- request_cwnd = REQUEST_CWND_INITIAL;
+ requests_this_cwnd = 0;
+ request_cwnd = request_cwnd_initial;
#endif
/* if the command-line included requests to randomize the IP
@@ -5360,17 +5375,21 @@
#ifdef WANT_FIRST_BURST
/* so, since we've gotten a response back, update the
bookkeeping accordingly. there is one less request
- outstanding and we can put one more out there than before. */
+ outstanding and we can put one more out there than
+ before. */
requests_outstanding -= 1;
if ((request_cwnd < first_burst_size) &&
- (NETPERF_IS_RR(direction))) {
+ (NETPERF_IS_RR(direction)) &&
+ (++requests_this_cwnd == request_cwnd)) {
request_cwnd += 1;
+ requests_this_cwnd = 0;
if (debug) {
fprintf(where,
- "incr req_cwnd to %d first_burst %d reqs_outstndng %d\n",
+ "incr req_cwnd to %d first_burst %d reqs_outstndng %di trans %lu\n",
request_cwnd,
first_burst_size,
- requests_outstanding);
+ requests_outstanding,
+ trans_completed + 1);
}
}
#endif
More information about the netperf-dev
mailing list