Home
last modified time | relevance | path

Searched hist:c3921ab71507b108d51a0f1ee960f80cd668a93d (Results 1 – 2 of 2) sorted by relevance

/linux/fs/
H A Dlocks.cdiff c3921ab71507b108d51a0f1ee960f80cd668a93d Mon May 12 01:04:48 CEST 2008 Linus Torvalds <torvalds@linux-foundation.org> 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
02b67cc3ba36bdba351d6c3a00593f4ec550d9d3 "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>
/linux/include/linux/
H A Dsched.hdiff c3921ab71507b108d51a0f1ee960f80cd668a93d Mon May 12 01:04:48 CEST 2008 Linus Torvalds <torvalds@linux-foundation.org> 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
02b67cc3ba36bdba351d6c3a00593f4ec550d9d3 "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>