Whamcloud - gitweb
b=19557 Add cond_resched calls to avoid hogging the cpu
authorRobert Read <rread@sun.com>
Wed, 13 Jan 2010 01:48:48 +0000 (17:48 -0800)
committerRobert Read <rread@sun.com>
Mon, 25 Jan 2010 18:21:51 +0000 (10:21 -0800)
a=johann
i=adilger
i=andrew.perepechko

libcfs/include/libcfs/darwin/kp30.h
libcfs/libcfs/hash.c
libcfs/libcfs/winnt/winnt-prim.c
lnet/klnds/iiblnd/iiblnd_cb.c
lnet/klnds/openiblnd/openiblnd_cb.c
lnet/klnds/viblnd/viblnd_cb.c
lustre/obdclass/genops.c

index 1fc1a1d..a1768af 100644 (file)
@@ -53,8 +53,6 @@
 #include <libcfs/darwin/darwin-prim.h>
 #include <lnet/lnet.h>
 
-#define our_cond_resched() cfs_schedule_timeout(CFS_TASK_INTERRUPTIBLE, 1)
-
 #ifdef CONFIG_SMP
 #define LASSERT_SPIN_LOCKED(lock) do {} while(0) /* XXX */
 #else
index 6369ada..56e2df5 100644 (file)
@@ -531,6 +531,7 @@ restart:
                         cfs_hash_runlock(hs);
                         func(obj, data);
                         (void)cfs_hash_put(hs, hnode);
+                        cfs_cond_resched();
                         goto restart;
                 }
                 cfs_write_unlock(&hsb->hsb_rwlock);
index f96bdd2..da12e24 100644 (file)
@@ -576,15 +576,6 @@ void cfs_clear_sigpending(void)
     return;
 }
 
-int cfs_need_resched(void)
-{
-        return 0;
-}
-
-void cfs_cond_resched(void)
-{
-}
-
 /*
  *  thread cpu affinity routines
  */
index fb6ce60..9e7b62c 100644 (file)
@@ -3310,7 +3310,7 @@ kibnal_scheduler(void *arg)
                         spin_unlock_irqrestore(&kibnal_data.kib_sched_lock,
                                                flags);
 
-                        our_cond_resched();
+                        cfs_cond_resched();
                         busy_loops = 0;
                         
                         spin_lock_irqsave(&kibnal_data.kib_sched_lock, flags);
index bb7f67b..20ce962 100644 (file)
@@ -2609,7 +2609,7 @@ kibnal_scheduler(void *arg)
                                         !list_empty(&kibnal_data.kib_sched_rxq) || 
                                         kibnal_data.kib_shutdown);
                         } else {
-                                our_cond_resched();
+                                cfs_cond_resched();
                         }
 
                         spin_lock_irqsave(&kibnal_data.kib_sched_lock,
index f1fa198..0b4248a 100644 (file)
@@ -3579,7 +3579,7 @@ kibnal_scheduler(void *arg)
                         spin_unlock_irqrestore(&kibnal_data.kib_sched_lock,
                                                flags);
 
-                        our_cond_resched();
+                        cfs_cond_resched();
                         busy_loops = 0;
 
                         spin_lock_irqsave(&kibnal_data.kib_sched_lock, flags);
index 3ea2c47..853dd86 100644 (file)
@@ -1485,6 +1485,7 @@ void obd_zombie_impexp_cull(void)
                 if (export != NULL)
                         class_export_destroy(export);
 
+                cfs_cond_resched();
         } while (import != NULL || export != NULL);
         EXIT;
 }