]> git.baikalelectronics.ru Git - kernel.git/commit
sched: optimize cond_resched()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 10 Jul 2009 12:57:57 +0000 (14:57 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Jul 2009 21:24:05 +0000 (14:24 -0700)
commita883b58f50023149c63b9679f1ac5a849585d7c0
tree32b3eaf766c1127ef2298c2e48b5441b7cf9b843
parentcee4a90581b99de71bb327c70b1b540bedd7b5c4
sched: optimize cond_resched()

Optimize cond_resched() by removing one conditional.

Currently cond_resched() checks system_state ==
SYSTEM_RUNNING in order to avoid scheduling before the
scheduler is running.

We can however, as per suggestion of Matt, use
PREEMPT_ACTIVE to accomplish that very same.

Suggested-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/sched.h
kernel/sched.c