]> git.baikalelectronics.ru Git - kernel.git/commit
Add new 'cond_resched_bkl()' helper function
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 May 2008 23:04:48 +0000 (16:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 May 2008 23:04:48 +0000 (16:04 -0700)
commit39de441207c9216a1abba4ff197ef0a0d3f6a6ea
treeb1408b898a8b50f15ad4a0cf1f29e17cc0138485
parent5953ff0513ff4e99541246f051e83dc3ec566167
Add new 'cond_resched_bkl()' helper function

It acts exactly like a regular 'cond_resched()', but will not get
optimized away when CONFIG_PREEMPT is set.

Normal kernel code is already preemptable in the presense of
CONFIG_PREEMPT, so cond_resched() is optimized away (see commit
4e1d8aef4f0775c9954ba4cf790e0f716aab2033 "sched: do not do
cond_resched() when CONFIG_PREEMPT").

But when wanting to conditionally reschedule while holding a lock, you
need to use "cond_sched_lock(lock)", and the new function is the BKL
equivalent of that.

Also make fs/locks.c use it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/locks.c
include/linux/sched.h
kernel/sched.c