summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@labri.fr>2005-05-21 17:50:15 +0200
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-21 10:46:48 -0700
commit10f02d1c59e55f529140dda3a92f0099d748451c (patch)
tree6b5a5804503401624171aff65b09ff022a9f0103 /kernel
parent9636273dae265b9354b861b373cd43cd76a6d0fe (diff)
downloadop-kernel-dev-10f02d1c59e55f529140dda3a92f0099d748451c.zip
op-kernel-dev-10f02d1c59e55f529140dda3a92f0099d748451c.tar.gz
[PATCH] spin_unlock_bh() and preempt_check_resched()
In _spin_unlock_bh(lock): do { \ _raw_spin_unlock(lock); \ preempt_enable(); \ local_bh_enable(); \ __release(lock); \ } while (0) there is no reason for using preempt_enable() instead of a simple preempt_enable_no_resched() Since we know bottom halves are disabled, preempt_schedule() will always return at once (preempt_count!=0), and hence preempt_check_resched() is useless here... This fixes it by using "preempt_enable_no_resched()" instead of the "preempt_enable()", and thus avoids the useless preempt_check_resched() just before re-enabling bottom halves. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/spinlock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index e15ed17..0c3f9d8 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -294,7 +294,7 @@ EXPORT_SYMBOL(_spin_unlock_irq);
void __lockfunc _spin_unlock_bh(spinlock_t *lock)
{
_raw_spin_unlock(lock);
- preempt_enable();
+ preempt_enable_no_resched();
local_bh_enable();
}
EXPORT_SYMBOL(_spin_unlock_bh);
@@ -318,7 +318,7 @@ EXPORT_SYMBOL(_read_unlock_irq);
void __lockfunc _read_unlock_bh(rwlock_t *lock)
{
_raw_read_unlock(lock);
- preempt_enable();
+ preempt_enable_no_resched();
local_bh_enable();
}
EXPORT_SYMBOL(_read_unlock_bh);
@@ -342,7 +342,7 @@ EXPORT_SYMBOL(_write_unlock_irq);
void __lockfunc _write_unlock_bh(rwlock_t *lock)
{
_raw_write_unlock(lock);
- preempt_enable();
+ preempt_enable_no_resched();
local_bh_enable();
}
EXPORT_SYMBOL(_write_unlock_bh);
@@ -354,7 +354,7 @@ int __lockfunc _spin_trylock_bh(spinlock_t *lock)
if (_raw_spin_trylock(lock))
return 1;
- preempt_enable();
+ preempt_enable_no_resched();
local_bh_enable();
return 0;
}
OpenPOWER on IntegriCloud