[openib-general] [PATCH] OpenSM component library: Incl_timer.c::__cl_timer_prov_cb, handle EINVAL properly

Hal Rosenstock halr at voltaire.com
Fri Nov 18 06:39:27 PST 2005


In cl_timer.c::__cl_timer_prov_cb, handle EINVAL
This occurs when there is too much work to do and OpenSM falls behind so
the callback occurs later than the expiration time. This causes OpenSM
to peg the CPU (consume 100% of the CPU).

Signed-off-by: Troy Benjegardes <troy at scl.ameslab.gov>
Signed-off-by: Hal Rosenstock <halr at voltaire.com>


Index: cl_timer.c
===================================================================
--- cl_timer.c  (revision 4077)
+++ cl_timer.c  (working copy)
@@ -180,8 +180,12 @@ __cl_timer_prov_cb(
       ret = pthread_cond_timedwait( &gp_timer_prov->cond,
                                     &gp_timer_prov->mutex,
&p_timer->timeout );

-      /* Sleep again on every event other than timeout */
-      if( ret != ETIMEDOUT )
+      /*
+         Sleep again on every event other than timeout and invalid
+         Note: EINVAL means that we got behind. This can occur when
+         we are very busy...
+       */
+      if( ret != ETIMEDOUT && ret != EINVAL )
         continue;

       /*







More information about the general mailing list