rpms/iperf/devel iperf-2.0.2-usleep.patch, NONE, 1.1 iperf.spec, 1.4, 1.5

Gabriel L. Somlo (somlo) fedora-extras-commits at redhat.com
Sun Oct 28 00:26:11 UTC 2007


Author: somlo

Update of /cvs/extras/rpms/iperf/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4099

Modified Files:
	iperf.spec 
Added Files:
	iperf-2.0.2-usleep.patch 
Log Message:
replace usleep with sched_yield to avoid hogging CPU (bugzilla #355211)


iperf-2.0.2-usleep.patch:

--- NEW FILE iperf-2.0.2-usleep.patch ---
diff -NarU5 iperf-2.0.2.orig/compat/Thread.c iperf-2.0.2/compat/Thread.c
--- iperf-2.0.2.orig/compat/Thread.c	2005-05-03 11:15:51.000000000 -0400
+++ iperf-2.0.2/compat/Thread.c	2007-10-27 20:17:10.000000000 -0400
@@ -403,13 +403,17 @@
  * is not guarenteed to actually rest.
  * ------------------------------------------------------------------- */
 void thread_rest ( void ) {
 #if defined( HAVE_THREAD )
 #if defined( HAVE_POSIX_THREAD )
-    // TODO add checks for sched_yield or pthread_yield and call that
-    // if available
+
+#if defined( _POSIX_PRIORITY_SCHEDULING )
+    sched_yield();
+#else
     usleep( 0 );
+#endif
+
 #else // Win32
     SwitchToThread( );
 #endif
 #endif
 }


Index: iperf.spec
===================================================================
RCS file: /cvs/extras/rpms/iperf/devel/iperf.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- iperf.spec	29 Jan 2007 17:56:27 -0000	1.4
+++ iperf.spec	28 Oct 2007 00:25:34 -0000	1.5
@@ -1,12 +1,13 @@
 Name: iperf
 Version: 2.0.2
-Release: 3%{?dist}
+Release: 4%{?dist}
 Summary: Measurement tool for TCP/UDP bandwidth performance
 License: BSD
 Group: Applications/Internet
 URL: http://dast.nlanr.net/Projects/Iperf/
 Source: http://dast.nlanr.net/Projects/Iperf2.0/%{name}-%{version}.tar.gz
-Patch: iperf-2.0.2-debug.patch
+Patch0: iperf-2.0.2-debug.patch
+Patch1: iperf-2.0.2-usleep.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
@@ -17,6 +18,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure
@@ -35,6 +37,9 @@
 %{_bindir}/iperf
 
 %changelog
+* Sat Oct 27 2007 Gabriel Somlo <somlo at cmu.edu> 2.0.2-4
+- replace usleep with sched_yield to avoid hogging CPU (bugzilla #355211)
+
 * Mon Jan 29 2007 Gabriel Somlo <somlo at cmu.edu> 2.0.2-3
 - patch to prevent removal of debug info by ville.sxytta(at)iki.fi
 




More information about the fedora-extras-commits mailing list