Skip to content

Commit

Permalink
[PATCH] Small schedule() optimization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Mohr authored and Linus Torvalds committed Mar 27, 2006
1 parent 013d386 commit 77e4bfb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 77e4bfb

Please sign in to comment.