From: Robert Read Date: Wed, 13 Jan 2010 01:48:48 +0000 (-0800) Subject: b=19557 Add cond_resched calls to avoid hogging the cpu X-Git-Tag: 1.10.0.36~31 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ebb833a501e0141053bf942efadf8b4bfde92000;ds=sidebyside b=19557 Add cond_resched calls to avoid hogging the cpu a=johann i=adilger i=andrew.perepechko --- diff --git a/libcfs/include/libcfs/darwin/kp30.h b/libcfs/include/libcfs/darwin/kp30.h index 1fc1a1d..a1768af 100644 --- a/libcfs/include/libcfs/darwin/kp30.h +++ b/libcfs/include/libcfs/darwin/kp30.h @@ -53,8 +53,6 @@ #include #include -#define our_cond_resched() cfs_schedule_timeout(CFS_TASK_INTERRUPTIBLE, 1) - #ifdef CONFIG_SMP #define LASSERT_SPIN_LOCKED(lock) do {} while(0) /* XXX */ #else diff --git a/libcfs/libcfs/hash.c b/libcfs/libcfs/hash.c index 6369ada..56e2df5 100644 --- a/libcfs/libcfs/hash.c +++ b/libcfs/libcfs/hash.c @@ -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); diff --git a/libcfs/libcfs/winnt/winnt-prim.c b/libcfs/libcfs/winnt/winnt-prim.c index f96bdd2..da12e24 100644 --- a/libcfs/libcfs/winnt/winnt-prim.c +++ b/libcfs/libcfs/winnt/winnt-prim.c @@ -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 */ diff --git a/lnet/klnds/iiblnd/iiblnd_cb.c b/lnet/klnds/iiblnd/iiblnd_cb.c index fb6ce60..9e7b62c 100644 --- a/lnet/klnds/iiblnd/iiblnd_cb.c +++ b/lnet/klnds/iiblnd/iiblnd_cb.c @@ -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); diff --git a/lnet/klnds/openiblnd/openiblnd_cb.c b/lnet/klnds/openiblnd/openiblnd_cb.c index bb7f67b..20ce962 100644 --- a/lnet/klnds/openiblnd/openiblnd_cb.c +++ b/lnet/klnds/openiblnd/openiblnd_cb.c @@ -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, diff --git a/lnet/klnds/viblnd/viblnd_cb.c b/lnet/klnds/viblnd/viblnd_cb.c index f1fa198..0b4248a 100644 --- a/lnet/klnds/viblnd/viblnd_cb.c +++ b/lnet/klnds/viblnd/viblnd_cb.c @@ -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); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 3ea2c47..853dd86 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -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; }