1
0
Fork 0
remarkable-linux/kernel/sched
Konstantin Khlebnikov 98197d3de5 sched/preempt: Fix cond_resched_lock() and cond_resched_softirq()
commit fe32d3cd5e upstream.

These functions check should_resched() before unlocking spinlock/bh-enable:
preempt_count always non-zero => should_resched() always returns false.
cond_resched_lock() worked iff spin_needbreak is set.

This patch adds argument "preempt_offset" to should_resched().

preempt_count offset constants for that:

  PREEMPT_DISABLE_OFFSET  - offset after preempt_disable()
  PREEMPT_LOCK_OFFSET     - offset after spin_lock()
  SOFTIRQ_DISABLE_OFFSET  - offset after local_bh_distable()
  SOFTIRQ_LOCK_OFFSET     - offset after spin_lock_bh()

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Graf <agraf@suse.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: bdb4380658 ("sched: Extract the basic add/sub preempt_count modifiers")
Link: http://lkml.kernel.org/r/20150715095204.12246.98268.stgit@buzz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 09:51:58 +09:00
..
Makefile ftrace: allow architectures to specify ftrace compile options 2015-01-29 09:19:19 +01:00
auto_group.c sched/autogroup: Fix failure to set cpu.rt_runtime_us 2015-02-18 16:17:20 +01:00
auto_group.h Revert "sched/autogroup: Fix crash on reboot when autogroup is disabled" 2012-12-11 10:23:45 +01:00
clock.c kernel/sched/clock.c: add another clock for use with the soft lockup watchdog 2015-02-12 18:54:13 -08:00
completion.c sched/completion: Serialize completion_done() with complete() 2015-02-18 14:27:40 +01:00
core.c sched/preempt: Fix cond_resched_lock() and cond_resched_softirq() 2015-10-27 09:51:58 +09:00
cpuacct.c cgroup: rename cgroup_subsys->base_cftypes to ->legacy_cftypes 2014-07-15 11:05:09 -04:00
cpuacct.h sched/cpuacct: Initialize root cpuacct earlier 2013-04-10 13:54:20 +02:00
cpudeadline.c sched/deadline: Remove cpu_active_mask from cpudl_find() 2015-02-04 07:52:29 +01:00
cpudeadline.h sched/deadline: Modify cpudl::free_cpus to reflect rd->online 2015-01-30 19:39:16 +01:00
cpupri.c Merge commit '3cf2f34' into sched/core, to fix build error 2014-06-12 13:46:37 +02:00
cpupri.h sched/cpupri: Remove unnecessary definitions in cpupri.h 2014-11-16 10:58:59 +01:00
cputime.c sched, time: Fix build error with 64 bit cputime_t on 32 bit systems 2014-10-03 05:46:55 +02:00
deadline.c sched/deadline: Support DL task migration during CPU hotplug 2015-04-02 17:42:57 +02:00
debug.c sched: Track group sched_entity usage contributions 2015-03-27 09:35:58 +01:00
fair.c sched/fair: Prevent throttling in early pick_next_task_fair() 2015-10-22 14:43:20 -07:00
features.h sched/rt: Use IPI to trigger RT task push migration instead of pulling 2015-03-23 10:55:22 +01:00
idle.c cpuidle: Run tick_broadcast_exit() with disabled interrupts 2015-04-29 15:19:21 +02:00
idle_task.c sched: Provide update_curr callbacks for stop/idle scheduling classes 2014-11-23 14:14:40 -08:00
proc.c cpuidle: menu: Lookup CPU runqueues less 2014-08-06 21:17:45 +02:00
rt.c sched/core: Remove unused argument from init_[rt|dl]_rq() 2015-04-02 17:42:55 +02:00
sched.h sched/core: Fix TASK_DEAD race in finish_task_switch() 2015-10-22 14:43:14 -07:00
stats.c sched: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
stats.h sched: Micro-optimize by dropping unnecessary task_rq() calls 2013-09-25 13:51:06 +02:00
stop_task.c sched: Provide update_curr callbacks for stop/idle scheduling classes 2014-11-23 14:14:40 -08:00
wait.c sched/wait: Fix a kthread race with wait_woken() 2014-11-04 07:17:44 +01:00