linux/include
Konstantin Khlebnikov fe32d3cd5e sched/preempt: Fix cond_resched_lock() and cond_resched_softirq()
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>
2015-08-03 12:21:24 +02:00
..
acpi Additional ACPICA material for v4.2-rc1 2015-07-02 17:11:28 -07:00
asm-generic sched/preempt: Fix cond_resched_lock() and cond_resched_softirq() 2015-08-03 12:21:24 +02:00
clocksource ARM: 8366/1: move Dual-Timer SP804 driver to drivers/clocksource 2015-06-02 09:58:18 +01:00
crypto crypto: rng - Do not free default RNG when it becomes unused 2015-06-22 15:49:18 +08:00
drm drm: use kvfree() in drm_free_large() 2015-06-30 19:44:59 -07:00
dt-bindings The changes to the common clock framework for 4.2 are dominated by new 2015-07-01 19:22:00 -07:00
keys
kvm
linux sched/preempt: Fix cond_resched_lock() and cond_resched_softirq() 2015-08-03 12:21:24 +02:00
math-emu
media Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2015-07-01 19:09:11 -07:00
memory
misc cxl: Add AFU virtual PHB and kernel API 2015-06-03 13:27:20 +10:00
net net: Kill sock->sk_protinfo 2015-06-28 16:55:44 -07:00
pcmcia
ras tracing: add trace event for memory-failure 2015-06-24 17:49:43 -07:00
rdma IB/mad: Add final OPA MAD processing 2015-06-12 14:49:18 -04:00
rxrpc
scsi SCSI misc on 20150622 2015-06-23 15:55:44 -07:00
soc Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2015-06-26 12:20:00 -07:00
sound ASoC: Further updates for v4.2 2015-06-22 11:32:41 +02:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
trace sched: Introduce the 'trace_sched_waking' tracepoint 2015-08-03 12:21:22 +02:00
uapi virtio/vhost: cross endian support 2015-07-03 16:02:25 -07:00
video Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2015-06-26 13:18:51 -07:00
xen xen/events: don't bind non-percpu VIRQs with percpu chip 2015-05-19 19:55:36 +01:00
Kbuild