Skip to content

Commit a5e2588

Browse files
Steven RostedtIngo Molnar
authored andcommitted
ftrace: replace raw_local_irq_save with local_irq_save
Impact: fix for lockdep and ftrace The raw_local_irq_save/restore confuses lockdep. This patch converts them to the local_irq_save/restore variants. Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent dfdc543 commit a5e2588

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

kernel/lockdep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Thanks to Arjan van de Ven for coming up with the initial idea of
2626
* mapping lock dependencies runtime.
2727
*/
28+
#define DISABLE_BRANCH_PROFILING
2829
#include <linux/mutex.h>
2930
#include <linux/sched.h>
3031
#include <linux/delay.h>

kernel/trace/trace.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ void trace_graph_entry(struct ftrace_graph_ent *trace)
12091209
int cpu;
12101210
int pc;
12111211

1212-
raw_local_irq_save(flags);
1212+
local_irq_save(flags);
12131213
cpu = raw_smp_processor_id();
12141214
data = tr->data[cpu];
12151215
disabled = atomic_inc_return(&data->disabled);
@@ -1218,7 +1218,7 @@ void trace_graph_entry(struct ftrace_graph_ent *trace)
12181218
__trace_graph_entry(tr, data, trace, flags, pc);
12191219
}
12201220
atomic_dec(&data->disabled);
1221-
raw_local_irq_restore(flags);
1221+
local_irq_restore(flags);
12221222
}
12231223

12241224
void trace_graph_return(struct ftrace_graph_ret *trace)
@@ -1230,7 +1230,7 @@ void trace_graph_return(struct ftrace_graph_ret *trace)
12301230
int cpu;
12311231
int pc;
12321232

1233-
raw_local_irq_save(flags);
1233+
local_irq_save(flags);
12341234
cpu = raw_smp_processor_id();
12351235
data = tr->data[cpu];
12361236
disabled = atomic_inc_return(&data->disabled);
@@ -1239,7 +1239,7 @@ void trace_graph_return(struct ftrace_graph_ret *trace)
12391239
__trace_graph_return(tr, data, trace, flags, pc);
12401240
}
12411241
atomic_dec(&data->disabled);
1242-
raw_local_irq_restore(flags);
1242+
local_irq_restore(flags);
12431243
}
12441244
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
12451245

@@ -2645,7 +2645,7 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf,
26452645
if (err)
26462646
goto err_unlock;
26472647

2648-
raw_local_irq_disable();
2648+
local_irq_disable();
26492649
__raw_spin_lock(&ftrace_max_lock);
26502650
for_each_tracing_cpu(cpu) {
26512651
/*
@@ -2662,7 +2662,7 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf,
26622662
}
26632663
}
26642664
__raw_spin_unlock(&ftrace_max_lock);
2665-
raw_local_irq_enable();
2665+
local_irq_enable();
26662666

26672667
tracing_cpumask = tracing_cpumask_new;
26682668

kernel/trace/trace_branch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect)
4242
if (unlikely(!tr))
4343
return;
4444

45-
raw_local_irq_save(flags);
45+
local_irq_save(flags);
4646
cpu = raw_smp_processor_id();
4747
if (atomic_inc_return(&tr->data[cpu]->disabled) != 1)
4848
goto out;
@@ -74,7 +74,7 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect)
7474

7575
out:
7676
atomic_dec(&tr->data[cpu]->disabled);
77-
raw_local_irq_restore(flags);
77+
local_irq_restore(flags);
7878
}
7979

8080
static inline

kernel/trace/trace_stack.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static inline void check_stack(void)
4848
if (!object_is_on_stack(&this_size))
4949
return;
5050

51-
raw_local_irq_save(flags);
51+
local_irq_save(flags);
5252
__raw_spin_lock(&max_stack_lock);
5353

5454
/* a race could have already updated it */
@@ -96,7 +96,7 @@ static inline void check_stack(void)
9696

9797
out:
9898
__raw_spin_unlock(&max_stack_lock);
99-
raw_local_irq_restore(flags);
99+
local_irq_restore(flags);
100100
}
101101

102102
static void
@@ -162,11 +162,11 @@ stack_max_size_write(struct file *filp, const char __user *ubuf,
162162
if (ret < 0)
163163
return ret;
164164

165-
raw_local_irq_save(flags);
165+
local_irq_save(flags);
166166
__raw_spin_lock(&max_stack_lock);
167167
*ptr = val;
168168
__raw_spin_unlock(&max_stack_lock);
169-
raw_local_irq_restore(flags);
169+
local_irq_restore(flags);
170170

171171
return count;
172172
}

0 commit comments

Comments
 (0)