An error occurred while fetching folder content.
sched/preempt: Fix cond_resched_lock() and cond_resched_softirq()
Konstantin Khlebnikov authored
commit fe32d3cd

 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: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: default avatarPeter 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 Mackerra...
98197d3d
Name Last commit Last update
..
bpf bpf: fix 64-bit divide
configs x86: Add "make tinyconfig" to configure the tiniest possible kernel
debug debug: prevent entering debug mode on panic/exception.
events perf: Fix AUX buffer refcounting
gcov gcov: fix softlockups
irq genirq: Fix race in register_irq_proc()
livepatch livepatch: add module locking around kallsyms calls
locking lockdep: Fix a race between /proc/lock_stat and module unload
power PM / sleep: Increase default DPM watchdog timeout to 60
printk security_syslog() should be called once only
rcu rcu: Correctly handle non-empty Tiny RCU callback list with none ready
sched sched/preempt: Fix cond_resched_lock() and cond_resched_softirq()
time time: Fix timekeeping_freqadjust()'s incorrect use of abs() instead of abs64()
trace ftrace: Fix breakage of set_ftrace_pid
.gitignore Ignore generated file kernel/x509_certificate_list
Kconfig.freezer container freezer: implement freezer cgroup subsystem
Kconfig.hz kernel: remove CONFIG_USE_GENERIC_SMP_HELPERS
Kconfig.locks locking/mcs: Better differentiate between MCS variants
Kconfig.preempt locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage
Makefile modsign: change default key details
acct.c acct: check FMODE_CAN_WRITE
async.c kernel/async.c: switch to pr_foo()
audit.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
audit.h Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit
audit_tree.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
audit_watch.c
auditfilter.c
auditsc.c
backtracetest.c
bounds.c
capability.c
cgroup.c
cgroup_freezer.c
compat.c
configs.c
context_tracking.c
cpu.c
cpu_pm.c
cpuset.c
crash_dump.c
cred.c
delayacct.c
dma.c
elfcore.c
exec_domain.c
exit.c
extable.c
fork.c
freezer.c
futex.c
futex_compat.c
groups.c
hung_task.c
irq_work.c
jump_label.c
kallsyms.c
kcmp.c
kexec.c
kmod.c
kprobes.c
ksysfs.c
kthread.c
latencytop.c
module-internal.h
module.c
module_signing.c
notifier.c
nsproxy.c
padata.c
panic.c
params.c
pid.c
pid_namespace.c
profile.c
ptrace.c
range.c
reboot.c
relay.c
resource.c
seccomp.c
signal.c
smp.c
smpboot.c
smpboot.h
softirq.c
stacktrace.c
stop_machine.c
sys.c
sys_ni.c
sysctl.c
sysctl_binary.c
system_certificates.S
system_keyring.c
task_work.c
taskstats.c
test_kprobes.c
torture.c
tracepoint.c
tsacct.c
uid16.c