blob: cce5cf0a31c17eb2f9b733349e2d51b458cec792 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
Upstream commit fe32d3cd5e8eb0f82e459763374aa80797023403 called:
"sched/preempt: Fix cond_resched_lock() and cond_resched_softirq()"
adds an argument 'preempt_offset' to should_resched().
This patch adds it to BFS.
Signed-off-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
--- linux-4.1.12/kernel/sched/bfs.c 2015-10-23 20:46:12.479367398 +0200
+++ linux-4.1.12-bfs/kernel/sched/bfs.c 2015-10-23 20:44:39.515377240 +0200
@@ -4663,7 +4663,7 @@
int __sched _cond_resched(void)
{
- if (should_resched()) {
+ if (should_resched(0)) {
preempt_schedule_common();
return 1;
}
@@ -4681,7 +4681,7 @@
*/
int __cond_resched_lock(spinlock_t *lock)
{
- int resched = should_resched();
+ int resched = should_resched(PREEMPT_LOCK_OFFSET);
int ret = 0;
lockdep_assert_held(lock);
@@ -4703,7 +4703,7 @@
{
BUG_ON(!in_softirq());
- if (should_resched()) {
+ if (should_resched(SOFTIRQ_DISABLE_OFFSET)) {
local_bh_enable();
preempt_schedule_common();
local_bh_disable();
|