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

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

lnet/include/libcfs/linux/linux-prim.h
lnet/lnet/router.c

index 1171c74..713718f 100644 (file)
@@ -151,7 +151,11 @@ typedef long                            cfs_task_state_t;
 #define cfs_waitq_broadcast(w)          wake_up_all(w)
 #define cfs_waitq_wait(l, s)            schedule()
 #define cfs_waitq_timedwait(l, s, t)    schedule_timeout(t)
-#define cfs_schedule_timeout(s, t)      schedule_timeout(t)
+#define cfs_schedule_timeout(s, t)             \
+({                                             \
+        set_current_state(s);                  \
+        schedule_timeout(t);                   \
+})
 #define cfs_schedule()                  schedule()
 #define cfs_kthread_run(fn, data, fmt, arg...) kthread_run(fn, data, fmt, ##arg)
 
index 1b55e87..9714c21 100644 (file)
@@ -862,7 +862,6 @@ rescan:
                 /* Call cfs_pause() here always adds 1 to load average 
                  * because kernel counts # active tasks as nr_running 
                  * + nr_uninterruptible. */
-                set_current_state(CFS_TASK_INTERRUPTIBLE);
                 cfs_schedule_timeout(CFS_TASK_INTERRUPTIBLE,
                                      cfs_time_seconds(1));
         }