Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/idle: fix suspicious RCU usage

After commit eb1f00237aca ("lockdep,trace: Expose tracepoints") the
lock tracepoints are visible to lockdep and RCU-lockdep is finding a
bunch more RCU violations that were previously hidden.

Switch the idle->seqcount over to using raw_write_*() to avoid the
lockdep annotation and thus the lock tracepoints.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Peter Zijlstra and committed by
Vasily Gorbik
ca589ea8 856deb86

+2 -3
+2 -3
arch/s390/kernel/idle.c
··· 39 39 local_irq_restore(flags); 40 40 41 41 /* Account time spent with enabled wait psw loaded as idle time. */ 42 - /* XXX seqcount has tracepoints that require RCU */ 43 - write_seqcount_begin(&idle->seqcount); 42 + raw_write_seqcount_begin(&idle->seqcount); 44 43 idle_time = idle->clock_idle_exit - idle->clock_idle_enter; 45 44 idle->clock_idle_enter = idle->clock_idle_exit = 0ULL; 46 45 idle->idle_time += idle_time; 47 46 idle->idle_count++; 48 47 account_idle_time(cputime_to_nsecs(idle_time)); 49 - write_seqcount_end(&idle->seqcount); 48 + raw_write_seqcount_end(&idle->seqcount); 50 49 } 51 50 NOKPROBE_SYMBOL(enabled_wait); 52 51