linux/arch
Martin Schwidefsky f285144f81 sched/x86: Do not clear PREEMPT_NEED_RESCHED on preempt count reset
The per-cpu preempt count of x86 contains two values, the actual preempt
count and the inverted PREEMPT_NEED_RESCHED bit. If a corrupted preempt
count is detected the preempt_count_set() function is used to reset the
preempt count.

In case the inverted PREEMPT_NEED_RESCHED bit is zero at the time of the
reset, the preemption indication is lost. Use raw_cpu_cmpxchg_4() to reset
only the count part and leave the PREEMPT_NEED_RESCHED bit as it is.

This improves the kernel's behavior when it runs into preempt count leaks
and tries to fix them up.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1478523660-733-1-git-send-email-schwidefsky@de.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-11-16 10:29:04 +01:00
..
alpha Merge branch 'gup_flag-cleanups' 2016-10-19 08:39:47 -07:00
arc ARC fixes for 4.9-rc5 2016-11-11 16:51:50 -08:00
arm KVM/ARM updates for v4.9-rc4 2016-11-11 11:13:36 +01:00
arm64 ARM fixes. There are a couple pending x86 patches but they'll have to 2016-11-13 10:28:53 -08:00
avr32 Merge branch 'akpm' (patches from Andrew) 2016-10-07 21:38:00 -07:00
blackfin Merge branch 'gup_flag-cleanups' 2016-10-19 08:39:47 -07:00
c6x nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00
cris cris/arch-v32: cryptocop: print a hex number after a 0x prefix 2016-10-27 18:43:43 -07:00
frv Merge branch 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-11 23:38:39 -07:00
h8300 h8300: fix syscall restarting 2016-10-27 18:43:42 -07:00
hexagon nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00
ia64 sched/cputime, powerpc, s390: Make scaled cputime arch specific 2016-11-15 09:51:05 +01:00
m32r mm: replace access_process_vm() write parameter with gup_flags 2016-10-19 08:31:25 -07:00
m68k Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
metag Metag architecture fixes for v4.9-rc1 2016-10-14 11:11:39 -07:00
microblaze Merge branch 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-11 23:38:39 -07:00
mips One NULL pointer dereference, and two fixes for regressions introduced 2016-11-04 13:08:05 -07:00
mn10300 Merge branch 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-11 23:38:39 -07:00
nios2 nios2: fix timer initcall return value 2016-11-11 08:45:08 -08:00
openrisc openrisc: Define __ro_after_init to avoid crash 2016-11-06 08:01:12 -08:00
parisc parisc: Ignore the pkey system calls for now 2016-11-02 23:07:14 +01:00
powerpc sched/cputime, powerpc, s390: Make scaled cputime arch specific 2016-11-15 09:51:05 +01:00
s390 Merge branch 'linus' into sched/core, to pick up fixes 2016-11-16 10:16:28 +01:00
score Merge branch 'gup_flag-cleanups' 2016-10-19 08:39:47 -07:00
sh Minor changes to improve J2 support and match Kconfig expectations of 2016-10-19 11:21:06 -07:00
sparc sparc64: Handle extremely large kernel TLB range flushes more gracefully. 2016-10-27 09:11:05 -07:00
tile tile: handle __ro_after_init like parisc does 2016-11-14 16:46:41 -05:00
um nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00
unicore32 unicore32: use simpler API for random address requests 2016-10-11 15:06:32 -07:00
x86 sched/x86: Do not clear PREEMPT_NEED_RESCHED on preempt count reset 2016-11-16 10:29:04 +01:00
xtensa Merge branch 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-11 23:38:39 -07:00
.gitignore
Kconfig sched/cputime, powerpc, s390: Make scaled cputime arch specific 2016-11-15 09:51:05 +01:00