]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Feb 2015 08:27:20 +0000 (16:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Feb 2015 08:27:20 +0000 (16:27 +0800)
added patches:
tracing-add-condition-check-to-rcu-lockdep-checks.patch
x86-tlb-trace-do-not-trace-on-cpu-that-is-offline.patch

queue-3.18/series
queue-3.18/tracing-add-condition-check-to-rcu-lockdep-checks.patch [new file with mode: 0644]
queue-3.18/x86-tlb-trace-do-not-trace-on-cpu-that-is-offline.patch [new file with mode: 0644]

index bd8497de8d1db9a192f4de8e6f9c7e6443a99209..6c6ef7b8ca5e0c2c422b86ea1e46acbcfd9292f9 100644 (file)
@@ -35,3 +35,5 @@ arm-dts-fix-i2s1-i2s2-compatible-for-exynos4-socs.patch
 x86-microcode-return-error-from-driver-init-code-when-loader-is-disabled.patch
 smpboot-add-missing-get_online_cpus-in-smpboot_register_percpu_thread.patch
 hrtimer-fix-incorrect-tai-offset-calculation-for-non-high-res-timer-systems.patch
+tracing-add-condition-check-to-rcu-lockdep-checks.patch
+x86-tlb-trace-do-not-trace-on-cpu-that-is-offline.patch
diff --git a/queue-3.18/tracing-add-condition-check-to-rcu-lockdep-checks.patch b/queue-3.18/tracing-add-condition-check-to-rcu-lockdep-checks.patch
new file mode 100644 (file)
index 0000000..e19a170
--- /dev/null
@@ -0,0 +1,48 @@
+From a05d59a5673339ef6936d6940cdf68172ce75b9f Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+Date: Fri, 6 Feb 2015 14:30:50 -0500
+Subject: tracing: Add condition check to RCU lockdep checks
+
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+
+commit a05d59a5673339ef6936d6940cdf68172ce75b9f upstream.
+
+The trace_tlb_flush() tracepoint can be called when a CPU is going offline.
+When a CPU is offline, RCU is no longer watching that CPU and since the
+tracepoint is protected by RCU, it must not be called. To prevent the
+tlb_flush tracepoint from being called when the CPU is offline, it was
+converted to a TRACE_EVENT_CONDITION where the condition checks if the
+CPU is online before calling the tracepoint.
+
+Unfortunately, this was not enough to stop lockdep from complaining about
+it. Even though the RCU protected code of the tracepoint will never be
+called, the condition is hidden within the tracepoint, and even though the
+condition prevents RCU code from being called, the lockdep checks are
+outside the tracepoint (this is to test tracepoints even when they are not
+enabled).
+
+Even though tracepoints should be checked to be RCU safe when they are not
+enabled, the condition should still be considered when checking RCU.
+
+Link: http://lkml.kernel.org/r/CA+icZUUGiGDoL5NU8RuxKzFjoLjEKRtUWx=JB8B9a0EQv-eGzQ@mail.gmail.com
+
+Fixes: 3a630178fd5f "tracing: generate RCU warnings even when tracepoints are disabled"
+Acked-by: Dave Hansen <dave@sr71.net>
+Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
+Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
+index e08e21e5f601..c72851328ca9 100644
+--- a/include/linux/tracepoint.h
++++ b/include/linux/tracepoint.h
+@@ -173,7 +173,7 @@ extern void syscall_unregfunc(void);
+                               TP_PROTO(data_proto),                   \
+                               TP_ARGS(data_args),                     \
+                               TP_CONDITION(cond),,);                  \
+-              if (IS_ENABLED(CONFIG_LOCKDEP)) {                       \
++              if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) {             \
+                       rcu_read_lock_sched_notrace();                  \
+                       rcu_dereference_sched(__tracepoint_##name.funcs);\
+                       rcu_read_unlock_sched_notrace();                \
diff --git a/queue-3.18/x86-tlb-trace-do-not-trace-on-cpu-that-is-offline.patch b/queue-3.18/x86-tlb-trace-do-not-trace-on-cpu-that-is-offline.patch
new file mode 100644 (file)
index 0000000..d2f2e93
--- /dev/null
@@ -0,0 +1,87 @@
+From 6c8465a82a605bc692304bab42703017dcfff013 Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+Date: Fri, 6 Feb 2015 14:18:19 -0500
+Subject: x86/tlb/trace: Do not trace on CPU that is offline
+
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+
+commit 6c8465a82a605bc692304bab42703017dcfff013 upstream.
+
+When taking a CPU down for suspend and resume, a tracepoint may be called
+when the CPU has been designated offline. As tracepoints require RCU for
+protection, they must not be called if the current CPU is offline.
+
+Unfortunately, trace_tlb_flush() is called in this scenario as was noted
+by LOCKDEP:
+
+...
+
+ Disabling non-boot CPUs ...
+ intel_pstate CPU 1 exiting
+
+ ===============================
+ smpboot: CPU 1 didn't die...
+ [ INFO: suspicious RCU usage. ]
+ 3.19.0-rc7-next-20150204.1-iniza-small #1 Not tainted
+ -------------------------------
+ include/trace/events/tlb.h:35 suspicious rcu_dereference_check() usage!
+
+ other info that might help us debug this:
+
+ RCU used illegally from offline CPU!
+ rcu_scheduler_active = 1, debug_locks = 0
+ no locks held by swapper/1/0.
+
+ stack backtrace:
+ CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.19.0-rc7-next-20150204.1-iniza-small #1
+ Hardware name: SAMSUNG ELECTRONICS CO., LTD. 530U3BI/530U4BI/530U4BH/530U3BI/530U4BI/530U4BH, BIOS 13XK 03/28/2013
+  0000000000000001 ffff88011a44fe18 ffffffff817e370d 0000000000000011
+  ffff88011a448290 ffff88011a44fe48 ffffffff810d6847 ffff8800c66b9600
+  0000000000000001 ffff88011a44c000 ffffffff81cb3900 ffff88011a44fe78
+ Call Trace:
+  [<ffffffff817e370d>] dump_stack+0x4c/0x65
+  [<ffffffff810d6847>] lockdep_rcu_suspicious+0xe7/0x120
+  [<ffffffff810b71a5>] idle_task_exit+0x205/0x2c0
+  [<ffffffff81054c4e>] play_dead_common+0xe/0x50
+  [<ffffffff81054ca5>] native_play_dead+0x15/0x140
+  [<ffffffff8102963f>] arch_cpu_idle_dead+0xf/0x20
+  [<ffffffff810cd89e>] cpu_startup_entry+0x37e/0x580
+  [<ffffffff81053e20>] start_secondary+0x140/0x150
+ intel_pstate CPU 2 exiting
+
+...
+
+By converting the tlb_flush tracepoint to a TRACE_EVENT_CONDITION where the
+condition is cpu_online(smp_processor_id()), we can avoid calling RCU protected
+code when the CPU is offline.
+
+Link: http://lkml.kernel.org/r/CA+icZUUGiGDoL5NU8RuxKzFjoLjEKRtUWx=JB8B9a0EQv-eGzQ@mail.gmail.com
+
+Fixes: d17d8f9dedb9 "x86/mm: Add tracepoints for TLB flushes"
+Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
+Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
+Suggested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Acked-by: Dave Hansen <dave@sr71.net>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h
+index 13391d288107..0e7635765153 100644
+--- a/include/trace/events/tlb.h
++++ b/include/trace/events/tlb.h
+@@ -13,11 +13,13 @@
+       { TLB_LOCAL_SHOOTDOWN,          "local shootdown" },            \
+       { TLB_LOCAL_MM_SHOOTDOWN,       "local mm shootdown" }
+-TRACE_EVENT(tlb_flush,
++TRACE_EVENT_CONDITION(tlb_flush,
+       TP_PROTO(int reason, unsigned long pages),
+       TP_ARGS(reason, pages),
++      TP_CONDITION(cpu_online(smp_processor_id())),
++
+       TP_STRUCT__entry(
+               __field(          int, reason)
+               __field(unsigned long,  pages)