From 44154cd87c510e6e1f8a3f33bea357b85f68d9be Mon Sep 17 00:00:00 2001 From: panda Date: Mon, 2 Nov 2009 12:27:00 +0000 Subject: [PATCH] b=21166 i=Oleg i=Johann reduce busy-waits by explicit set_task_state(...), cleanup --- lnet/include/libcfs/linux/linux-prim.h | 6 +++++- lnet/lnet/router.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lnet/include/libcfs/linux/linux-prim.h b/lnet/include/libcfs/linux/linux-prim.h index 1171c74..713718f 100644 --- a/lnet/include/libcfs/linux/linux-prim.h +++ b/lnet/include/libcfs/linux/linux-prim.h @@ -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) diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index 1b55e87..9714c21 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -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)); } -- 1.8.3.1