summaryrefslogtreecommitdiff
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorAndreas Mohr <andi@lisas.de>2006-03-27 09:15:20 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 16:44:43 (GMT)
commit77e4bfbcf071f795b54862455dce8902b3fc29c2 (patch)
treecde3cb39a72de0bb8b42c1c5752f25b3b16bf5ee /kernel/sched.c
parent013d3868143387be99bb0373d49452eaa3c55d41 (diff)
downloadlinux-77e4bfbcf071f795b54862455dce8902b3fc29c2.tar.xz
[PATCH] Small schedule() optimization
small schedule() microoptimization. Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index dc599c8..a96a05d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2879,13 +2879,11 @@ asmlinkage void __sched schedule(void)
* schedule() atomically, we ignore that path for now.
* Otherwise, whine if we are scheduling when we should not be.
*/
- if (likely(!current->exit_state)) {
- if (unlikely(in_atomic())) {
- printk(KERN_ERR "BUG: scheduling while atomic: "
- "%s/0x%08x/%d\n",
- current->comm, preempt_count(), current->pid);
- dump_stack();
- }
+ if (unlikely(in_atomic() && !current->exit_state)) {
+ printk(KERN_ERR "BUG: scheduling while atomic: "
+ "%s/0x%08x/%d\n",
+ current->comm, preempt_count(), current->pid);
+ dump_stack();
}
profile_hit(SCHED_PROFILING, __builtin_return_address(0));