tracing: Fix lockdep warning in global_clock()
PATCH RESEND 1/1 tracing: Fix lockdep warning in global_clock()
# echo 1 > events/enable # echo global > trace_clock
------------[ cut here ]------------ WARNING: at kernel/lockdep.c:3162 check_flags+0xb2/0x190() ... ---[ end trace 3f86734a89416623 ]---
possible reason: unannotated irqs-on.
...
--- kernel/trace/trace_clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_clock.c +2 -2
@@ -84,7 +84,7 @@ u64 notrace trace_clock_global(void)int this_cpu;u64 now; -raw_local_irq_save (flags); +local_irq_save (flags); this_cpu =raw_smp_processor_id (); now =cpu_clock (this_cpu);
@@ -110,7 +110,7 @@ u64 notrace trace_clock_global(void)arch_spin_unlock (&trace_clock_struct.lock); out: -raw_local_irq_restore (flags); +local_irq_restore (flags);return now; }
Signature · 1 line
1.6.3
Steven Rostedt
maintainerQuoted 10 lines · Li Zefan
# echo 1 > events/enable # echo global > trace_clock------------[ cut here ]------------ WARNING: at kernel/lockdep.c:3162 check_flags+0xb2/0x190() ... ---[ end trace 3f86734a89416623 ]---possible reason: unannotated irqs-on.
...
Peter,
I see no problem with this patch, but I do want your Acked-by for it.
Thanks,
-- Steve
Quoted 27 lines
Signed-off-by Li Zefan <[email protected]>--- kernel/trace/trace_clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)kernel/trace/trace_clock.c +2
-2@@ -84,7 +84,7 @@ u64 notrace trace_clock_global(void)int this_cpu;u64 now; -raw_local_irq_save (flags); +local_irq_save (flags); this_cpu =raw_smp_processor_id (); now =cpu_clock (this_cpu);@@ -110,7 +110,7 @@ u64 notrace trace_clock_global(void)arch_spin_unlock (&trace_clock_struct.lock); out: -raw_local_irq_restore (flags); +local_irq_restore (flags);return now; }
Quoted 11 lines · Li Zefan
# echo 1 > events/enable # echo global > trace_clock------------[ cut here ]------------ WARNING: at kernel/lockdep.c:3162 check_flags+0xb2/0x190() ... ---[ end trace 3f86734a89416623 ]---possible reason: unannotated irqs-on.
...Signed-off-by Li Zefan <[email protected]>
Quoted 26 lines
--- kernel/trace/trace_clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)kernel/trace/trace_clock.c +2
-2@@ -84,7 +84,7 @@ u64 notrace trace_clock_global(void)int this_cpu;u64 now; -raw_local_irq_save (flags); +local_irq_save (flags); this_cpu =raw_smp_processor_id (); now =cpu_clock (this_cpu);@@ -110,7 +110,7 @@ u64 notrace trace_clock_global(void)arch_spin_unlock (&trace_clock_struct.lock); out: -raw_local_irq_restore (flags); +local_irq_restore (flags);return now; }
Commit-ID: 581fe9449d181f6bd5afc5dcae37526eeee02b1d Gitweb: http://git.kernel.org/tip/581fe9449d181f6bd5afc5dcae37526eeee02b1d Author: Li Zefan <[email protected]> AuthorDate: Wed, 24 Mar 2010 10:57:37 +0800 Committer: Steven Rostedt <[email protected]> CommitDate: Fri, 26 Mar 2010 15:41:59 -0400
tracing: Fix lockdep warning in global_clock()
# echo 1 > events/enable # echo global > trace_clock
------------[ cut here ]------------ WARNING: at kernel/lockdep.c:3162 check_flags+0xb2/0x190() ... ---[ end trace 3f86734a89416623 ]---
possible reason: unannotated irqs-on.
...
There's no reason to use the raw_local_irq_save() in trace_clock_global. The local_irq_save() version is fine, and does not cause the bug in lockdep.
LKML-Reference: <[email protected]>
--- kernel/trace/trace_clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_clock.c +2 -2
@@ -84,7 +84,7 @@ u64 notrace trace_clock_global(void)int this_cpu;u64 now; -raw_local_irq_save (flags); +local_irq_save (flags); this_cpu =raw_smp_processor_id (); now =cpu_clock (this_cpu);
@@ -110,7 +110,7 @@ u64 notrace trace_clock_global(void)arch_spin_unlock (&trace_clock_struct.lock); out: -raw_local_irq_restore (flags); +local_irq_restore (flags);return now; }
Commit-ID: e36673ec5126f15a8cddf6049aede7bdcf484c26 Gitweb: http://git.kernel.org/tip/e36673ec5126f15a8cddf6049aede7bdcf484c26 Author: Li Zefan <[email protected]> AuthorDate: Wed, 24 Mar 2010 10:57:37 +0800 Committer: Steven Rostedt <[email protected]> CommitDate: Mon, 29 Mar 2010 15:16:44 -0400
tracing: Fix lockdep warning in global_clock()
# echo 1 > events/enable # echo global > trace_clock
------------[ cut here ]------------ WARNING: at kernel/lockdep.c:3162 check_flags+0xb2/0x190() ... ---[ end trace 3f86734a89416623 ]---
possible reason: unannotated irqs-on.
...
There's no reason to use the raw_local_irq_save() in trace_clock_global. The local_irq_save() version is fine, and does not cause the bug in lockdep.
LKML-Reference: <[email protected]>
--- kernel/trace/trace_clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_clock.c +2 -2
@@ -84,7 +84,7 @@ u64 notrace trace_clock_global(void)int this_cpu;u64 now; -raw_local_irq_save (flags); +local_irq_save (flags); this_cpu =raw_smp_processor_id (); now =cpu_clock (this_cpu);
@@ -110,7 +110,7 @@ u64 notrace trace_clock_global(void)arch_spin_unlock (&trace_clock_struct.lock); out: -raw_local_irq_restore (flags); +local_irq_restore (flags);return now; }