From 1fe475226050a2aa9ba39e24fd23f53726a6b26c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 11 May 2008 16:04:48 -0700 Subject: [PATCH] --- yaml --- r: 96383 b: refs/heads/master c: c3921ab71507b108d51a0f1ee960f80cd668a93d h: refs/heads/master i: 96381: 4c308bc76244f4f12311fd8dc2911551114f9f00 96379: 6606361143ed886355c4bf8816a8ff51bdb25367 96375: 7e6d6c7f0684038c129ba7cb8f49e158b607dfa6 96367: 30d358c34fe21854927900b0fa313decb35fefe8 96351: b2153dd619c8c962663f832cb31dd9c20d1fdc10 96319: efa4e8a944fd6bb2853ff6724a42ffcf85689b98 96255: 3cbcae632b73198afa813322443f68cd8c533843 v: v3 --- [refs] | 2 +- trunk/fs/locks.c | 2 +- trunk/include/linux/sched.h | 6 +++++- trunk/kernel/sched.c | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index a94d8b059f64..e0f5d4a88dd1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9662369786b9d07fd46d65b0f9e3938a3e01a5d9 +refs/heads/master: c3921ab71507b108d51a0f1ee960f80cd668a93d diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index 0ac6b92cb0b6..11dbf08651b7 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -773,7 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) * give it the opportunity to lock the file. */ if (found) - cond_resched(); + cond_resched_bkl(); find_conflict: for_each_lock(inode, before) { diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 0c35b0343a76..4ab9f32f9238 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -2037,13 +2037,13 @@ static inline int need_resched(void) * cond_resched_lock() will drop the spinlock before scheduling, * cond_resched_softirq() will enable bhs before scheduling. */ +extern int _cond_resched(void); #ifdef CONFIG_PREEMPT static inline int cond_resched(void) { return 0; } #else -extern int _cond_resched(void); static inline int cond_resched(void) { return _cond_resched(); @@ -2051,6 +2051,10 @@ static inline int cond_resched(void) #endif extern int cond_resched_lock(spinlock_t * lock); extern int cond_resched_softirq(void); +static inline int cond_resched_bkl(void) +{ + return _cond_resched(); +} /* * Does a critical section need to be broken due to another diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index c51b6565e07c..8841a915545d 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -5525,7 +5525,6 @@ static void __cond_resched(void) } while (need_resched()); } -#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY) int __sched _cond_resched(void) { if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) && @@ -5536,7 +5535,6 @@ int __sched _cond_resched(void) return 0; } EXPORT_SYMBOL(_cond_resched); -#endif /* * cond_resched_lock() - if a reschedule is pending, drop the given lock,