Whamcloud - gitweb
b=21166
authorpanda <panda>
Mon, 2 Nov 2009 12:28:03 +0000 (12:28 +0000)
committerpanda <panda>
Mon, 2 Nov 2009 12:28:03 +0000 (12:28 +0000)
i=Oleg
i=Johann

reduce busy-waits by explicit set_task_state(...), cleanup

lustre/include/obd_support.h
lustre/obdecho/echo.c

index 2b0988b..4bf5007 100644 (file)
@@ -382,10 +382,8 @@ do {                                                                         \
         if (unlikely(obd_fail_loc && (_ret_ = obd_fail_check(id)))) {        \
                 CERROR("obd_fail_timeout id %x sleeping for %d secs\n",      \
                        (id), (secs));                                        \
-                set_current_state(TASK_UNINTERRUPTIBLE);                     \
                 cfs_schedule_timeout(CFS_TASK_UNINT,                         \
                                     cfs_time_seconds(secs));                 \
-                set_current_state(TASK_RUNNING);                             \
                 CERROR("obd_fail_timeout id %x awake\n", (id));              \
         }                                                                    \
         _ret_;                                                               \
@@ -396,10 +394,8 @@ do {                                                                         \
         if (unlikely(obd_fail_loc && (_ret_ = obd_fail_check(id)))) {        \
                 CERROR("obd_fail_timeout id %x sleeping for %d ms\n",        \
                        (id), (ms));                                          \
-                set_current_state(TASK_UNINTERRUPTIBLE);                     \
                 cfs_schedule_timeout(CFS_TASK_UNINT,                         \
                                      cfs_time_seconds(ms)/1000);             \
-                set_current_state(TASK_RUNNING);                             \
                 CERROR("obd_fail_timeout id %x awake\n", (id));              \
         }                                                                    \
         _ret_;                                                               \
index 947ebfe..ec65a08 100644 (file)
@@ -551,7 +551,6 @@ static int echo_cleanup(struct obd_device *obd)
 
         /* XXX Bug 3413; wait for a bit to ensure the BL callback has
          * happened before calling ldlm_namespace_free() */
-        set_current_state (TASK_UNINTERRUPTIBLE);
         cfs_schedule_timeout (CFS_TASK_UNINT, cfs_time_seconds(1));
 
         ldlm_namespace_free(obd->obd_namespace, NULL, obd->obd_force);