diff options
Diffstat (limited to 'kernel/rcutiny.c')
-rw-r--r-- | kernel/rcutiny.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index b4e0b4981768..9b9bdf666fb5 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c | |||
@@ -53,20 +53,21 @@ static void __call_rcu(struct rcu_head *head, | |||
53 | 53 | ||
54 | #include "rcutiny_plugin.h" | 54 | #include "rcutiny_plugin.h" |
55 | 55 | ||
56 | static long long rcu_dynticks_nesting = LLONG_MAX / 2; | 56 | static long long rcu_dynticks_nesting = DYNTICK_TASK_NESTING; |
57 | 57 | ||
58 | /* Common code for rcu_idle_enter() and rcu_irq_exit(), see kernel/rcutree.c. */ | 58 | /* Common code for rcu_idle_enter() and rcu_irq_exit(), see kernel/rcutree.c. */ |
59 | static void rcu_idle_enter_common(void) | 59 | static void rcu_idle_enter_common(long long oldval) |
60 | { | 60 | { |
61 | if (rcu_dynticks_nesting) { | 61 | if (rcu_dynticks_nesting) { |
62 | RCU_TRACE(trace_rcu_dyntick("--=", rcu_dynticks_nesting)); | 62 | RCU_TRACE(trace_rcu_dyntick("--=", |
63 | oldval, rcu_dynticks_nesting)); | ||
63 | return; | 64 | return; |
64 | } | 65 | } |
65 | RCU_TRACE(trace_rcu_dyntick("Start", rcu_dynticks_nesting)); | 66 | RCU_TRACE(trace_rcu_dyntick("Start", oldval, rcu_dynticks_nesting)); |
66 | if (!idle_cpu(smp_processor_id())) { | 67 | if (!idle_cpu(smp_processor_id())) { |
67 | WARN_ON_ONCE(1); /* must be idle task! */ | 68 | WARN_ON_ONCE(1); /* must be idle task! */ |
68 | RCU_TRACE(trace_rcu_dyntick("Error on entry: not idle task", | 69 | RCU_TRACE(trace_rcu_dyntick("Error on entry: not idle task", |
69 | rcu_dynticks_nesting)); | 70 | oldval, rcu_dynticks_nesting)); |
70 | ftrace_dump(DUMP_ALL); | 71 | ftrace_dump(DUMP_ALL); |
71 | } | 72 | } |
72 | rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */ | 73 | rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */ |
@@ -79,10 +80,12 @@ static void rcu_idle_enter_common(void) | |||
79 | void rcu_idle_enter(void) | 80 | void rcu_idle_enter(void) |
80 | { | 81 | { |
81 | unsigned long flags; | 82 | unsigned long flags; |
83 | long long oldval; | ||
82 | 84 | ||
83 | local_irq_save(flags); | 85 | local_irq_save(flags); |
86 | oldval = rcu_dynticks_nesting; | ||
84 | rcu_dynticks_nesting = 0; | 87 | rcu_dynticks_nesting = 0; |
85 | rcu_idle_enter_common(); | 88 | rcu_idle_enter_common(oldval); |
86 | local_irq_restore(flags); | 89 | local_irq_restore(flags); |
87 | } | 90 | } |
88 | 91 | ||
@@ -92,11 +95,13 @@ void rcu_idle_enter(void) | |||
92 | void rcu_irq_exit(void) | 95 | void rcu_irq_exit(void) |
93 | { | 96 | { |
94 | unsigned long flags; | 97 | unsigned long flags; |
98 | long long oldval; | ||
95 | 99 | ||
96 | local_irq_save(flags); | 100 | local_irq_save(flags); |
101 | oldval = rcu_dynticks_nesting; | ||
97 | rcu_dynticks_nesting--; | 102 | rcu_dynticks_nesting--; |
98 | WARN_ON_ONCE(rcu_dynticks_nesting < 0); | 103 | WARN_ON_ONCE(rcu_dynticks_nesting < 0); |
99 | rcu_idle_enter_common(); | 104 | rcu_idle_enter_common(oldval); |
100 | local_irq_restore(flags); | 105 | local_irq_restore(flags); |
101 | } | 106 | } |
102 | 107 | ||
@@ -104,14 +109,15 @@ void rcu_irq_exit(void) | |||
104 | static void rcu_idle_exit_common(long long oldval) | 109 | static void rcu_idle_exit_common(long long oldval) |
105 | { | 110 | { |
106 | if (oldval) { | 111 | if (oldval) { |
107 | RCU_TRACE(trace_rcu_dyntick("++=", rcu_dynticks_nesting)); | 112 | RCU_TRACE(trace_rcu_dyntick("++=", |
113 | oldval, rcu_dynticks_nesting)); | ||
108 | return; | 114 | return; |
109 | } | 115 | } |
110 | RCU_TRACE(trace_rcu_dyntick("End", oldval)); | 116 | RCU_TRACE(trace_rcu_dyntick("End", oldval, rcu_dynticks_nesting)); |
111 | if (!idle_cpu(smp_processor_id())) { | 117 | if (!idle_cpu(smp_processor_id())) { |
112 | WARN_ON_ONCE(1); /* must be idle task! */ | 118 | WARN_ON_ONCE(1); /* must be idle task! */ |
113 | RCU_TRACE(trace_rcu_dyntick("Error on exit: not idle task", | 119 | RCU_TRACE(trace_rcu_dyntick("Error on exit: not idle task", |
114 | oldval)); | 120 | oldval, rcu_dynticks_nesting)); |
115 | ftrace_dump(DUMP_ALL); | 121 | ftrace_dump(DUMP_ALL); |
116 | } | 122 | } |
117 | } | 123 | } |
@@ -127,7 +133,7 @@ void rcu_idle_exit(void) | |||
127 | local_irq_save(flags); | 133 | local_irq_save(flags); |
128 | oldval = rcu_dynticks_nesting; | 134 | oldval = rcu_dynticks_nesting; |
129 | WARN_ON_ONCE(oldval != 0); | 135 | WARN_ON_ONCE(oldval != 0); |
130 | rcu_dynticks_nesting = LLONG_MAX / 2; | 136 | rcu_dynticks_nesting = DYNTICK_TASK_NESTING; |
131 | rcu_idle_exit_common(oldval); | 137 | rcu_idle_exit_common(oldval); |
132 | local_irq_restore(flags); | 138 | local_irq_restore(flags); |
133 | } | 139 | } |