mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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
02b67cc3ba "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 <[email protected]>
This commit is contained in:
parent
9662369786
commit
c3921ab715
3 changed files with 6 additions and 4 deletions
|
|
@ -773,7 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
|
|||
* give it the opportunity to lock the file.
|
||||
*/
|
||||
if (found)
|
||||
cond_resched();
|
||||
cond_resched_bkl();
|
||||
|
||||
find_conflict:
|
||||
for_each_lock(inode, before) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue