]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0302-trace-Use-rcuidle-version-for-preemptoff_hist-trace-.patch
Fix memguard and related syscalls
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0302-trace-Use-rcuidle-version-for-preemptoff_hist-trace-.patch
1 From aca5b8f636abf1517bef36987a35c3097bdef90a Mon Sep 17 00:00:00 2001
2 From: Yang Shi <yang.shi@windriver.com>
3 Date: Tue, 23 Feb 2016 13:23:23 -0800
4 Subject: [PATCH 302/366] trace: Use rcuidle version for preemptoff_hist trace
5  point
6
7 When running -rt kernel with both PREEMPT_OFF_HIST and LOCKDEP enabled,
8 the below error is reported:
9
10  [ INFO: suspicious RCU usage. ]
11  4.4.1-rt6 #1 Not tainted
12  include/trace/events/hist.h:31 suspicious rcu_dereference_check() usage!
13
14  other info that might help us debug this:
15
16  RCU used illegally from idle CPU!
17  rcu_scheduler_active = 1, debug_locks = 0
18  RCU used illegally from extended quiescent state!
19  no locks held by swapper/0/0.
20
21  stack backtrace:
22  CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.1-rt6-WR8.0.0.0_standard #1
23  Stack : 0000000000000006 0000000000000000 ffffffff81ca8c38 ffffffff81c8fc80
24     ffffffff811bdd68 ffffffff81cb0000 0000000000000000 ffffffff81cb0000
25     0000000000000000 0000000000000000 0000000000000004 0000000000000000
26     0000000000000004 ffffffff811bdf50 0000000000000000 ffffffff82b60000
27     0000000000000000 ffffffff812897ac ffffffff819f0000 000000000000000b
28     ffffffff811be460 ffffffff81b7c588 ffffffff81c8fc80 0000000000000000
29     0000000000000000 ffffffff81ec7f88 ffffffff81d70000 ffffffff81b70000
30     ffffffff81c90000 ffffffff81c3fb00 ffffffff81c3fc28 ffffffff815e6f98
31     0000000000000000 ffffffff81c8fa87 ffffffff81b70958 ffffffff811bf2c4
32     0707fe32e8d60ca5 ffffffff81126d60 0000000000000000 0000000000000000
33     ...
34  Call Trace:
35  [<ffffffff81126d60>] show_stack+0xe8/0x108
36  [<ffffffff815e6f98>] dump_stack+0x88/0xb0
37  [<ffffffff8124b88c>] time_hardirqs_off+0x204/0x300
38  [<ffffffff811aa5dc>] trace_hardirqs_off_caller+0x24/0xe8
39  [<ffffffff811a4ec4>] cpu_startup_entry+0x39c/0x508
40  [<ffffffff81d7dc68>] start_kernel+0x584/0x5a0
41
42 Replace regular trace_preemptoff_hist to rcuidle version to avoid the error.
43
44 Signed-off-by: Yang Shi <yang.shi@windriver.com>
45 Cc: bigeasy@linutronix.de
46 Cc: rostedt@goodmis.org
47 Cc: linux-rt-users@vger.kernel.org
48 Link: http://lkml.kernel.org/r/1456262603-10075-1-git-send-email-yang.shi@windriver.com
49 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
50 ---
51  kernel/trace/trace_irqsoff.c | 8 ++++----
52  1 file changed, 4 insertions(+), 4 deletions(-)
53
54 diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
55 index 5c3fcb7..553e712 100644
56 --- a/kernel/trace/trace_irqsoff.c
57 +++ b/kernel/trace/trace_irqsoff.c
58 @@ -425,13 +425,13 @@ void start_critical_timings(void)
59  {
60         if (preempt_trace() || irq_trace())
61                 start_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
62 -       trace_preemptirqsoff_hist(TRACE_START, 1);
63 +       trace_preemptirqsoff_hist_rcuidle(TRACE_START, 1);
64  }
65  EXPORT_SYMBOL_GPL(start_critical_timings);
66  
67  void stop_critical_timings(void)
68  {
69 -       trace_preemptirqsoff_hist(TRACE_STOP, 0);
70 +       trace_preemptirqsoff_hist_rcuidle(TRACE_STOP, 0);
71         if (preempt_trace() || irq_trace())
72                 stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
73  }
74 @@ -441,7 +441,7 @@ EXPORT_SYMBOL_GPL(stop_critical_timings);
75  #ifdef CONFIG_PROVE_LOCKING
76  void time_hardirqs_on(unsigned long a0, unsigned long a1)
77  {
78 -       trace_preemptirqsoff_hist(IRQS_ON, 0);
79 +       trace_preemptirqsoff_hist_rcuidle(IRQS_ON, 0);
80         if (!preempt_trace() && irq_trace())
81                 stop_critical_timing(a0, a1);
82  }
83 @@ -450,7 +450,7 @@ void time_hardirqs_off(unsigned long a0, unsigned long a1)
84  {
85         if (!preempt_trace() && irq_trace())
86                 start_critical_timing(a0, a1);
87 -       trace_preemptirqsoff_hist(IRQS_OFF, 1);
88 +       trace_preemptirqsoff_hist_rcuidle(IRQS_OFF, 1);
89  }
90  
91  #else /* !CONFIG_PROVE_LOCKING */
92 -- 
93 1.9.1
94