mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes
@ 2010-03-30  2:58 Steven Rostedt
  2010-03-30  2:58 ` [PATCH 1/2] tracing: Fix lockdep warning in global_clock() Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Steven Rostedt @ 2010-03-30  2:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker


Ingo,

I rebased my branch against yours and removed the module patch
since it looks like it is no longer urgent. I moved it over to
my core branch along with a fix to the compile error you saw with it.
I'll be pushing that later this week.

These two patchs still should go into 34.

Please pull the latest tip/tracing/urgent tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/urgent


Julia Lawall (1):
      ring-buffer: Add missing unlock

Li Zefan (1):
      tracing: Fix lockdep warning in global_clock()

----
 kernel/trace/ring_buffer.c |    8 +++++---
 kernel/trace/trace_clock.c |    4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] tracing: Fix lockdep warning in global_clock()
  2010-03-30  2:58 [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes Steven Rostedt
@ 2010-03-30  2:58 ` Steven Rostedt
  2010-03-30  2:58 ` [PATCH 2/2] ring-buffer: Add missing unlock Steven Rostedt
  2010-04-02 20:07 ` [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2010-03-30  2:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Peter Zijlstra,
	Li Zefan

[-- Attachment #1: 0001-tracing-Fix-lockdep-warning-in-global_clock.patch --]
[-- Type: text/plain, Size: 1291 bytes --]

From: Li Zefan <lizf@cn.fujitsu.com>

# 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.

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4BA97FA1.7030606@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
index 6fbfb8f..9d589d8 100644
--- a/kernel/trace/trace_clock.c
+++ b/kernel/trace/trace_clock.c
@@ -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;
 }
-- 
1.7.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ring-buffer: Add missing unlock
  2010-03-30  2:58 [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes Steven Rostedt
  2010-03-30  2:58 ` [PATCH 1/2] tracing: Fix lockdep warning in global_clock() Steven Rostedt
@ 2010-03-30  2:58 ` Steven Rostedt
  2010-04-02 20:07 ` [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2010-03-30  2:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Julia Lawall

[-- Attachment #1: 0002-ring-buffer-Add-missing-unlock.patch --]
[-- Type: text/plain, Size: 1933 bytes --]

From: Julia Lawall <julia@diku.dk>

In some error handling cases the lock is not unlocked.  The return is
converted to a goto, to share the unlock at the end of the function.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E1;
identifier f;
@@

f (...) { <+...
* spin_lock_irq (E1,...);
... when != E1
* return ...;
...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
LKML-Reference: <Pine.LNX.4.64.1003291736440.21896@ask.diku.dk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ring_buffer.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index d1187ef..9a0f9bf 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1209,18 +1209,19 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
 
 	for (i = 0; i < nr_pages; i++) {
 		if (RB_WARN_ON(cpu_buffer, list_empty(cpu_buffer->pages)))
-			return;
+			goto out;
 		p = cpu_buffer->pages->next;
 		bpage = list_entry(p, struct buffer_page, list);
 		list_del_init(&bpage->list);
 		free_buffer_page(bpage);
 	}
 	if (RB_WARN_ON(cpu_buffer, list_empty(cpu_buffer->pages)))
-		return;
+		goto out;
 
 	rb_reset_cpu(cpu_buffer);
 	rb_check_pages(cpu_buffer);
 
+out:
 	spin_unlock_irq(&cpu_buffer->reader_lock);
 }
 
@@ -1237,7 +1238,7 @@ rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer,
 
 	for (i = 0; i < nr_pages; i++) {
 		if (RB_WARN_ON(cpu_buffer, list_empty(pages)))
-			return;
+			goto out;
 		p = pages->next;
 		bpage = list_entry(p, struct buffer_page, list);
 		list_del_init(&bpage->list);
@@ -1246,6 +1247,7 @@ rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer,
 	rb_reset_cpu(cpu_buffer);
 	rb_check_pages(cpu_buffer);
 
+out:
 	spin_unlock_irq(&cpu_buffer->reader_lock);
 }
 
-- 
1.7.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes
  2010-03-30  2:58 [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes Steven Rostedt
  2010-03-30  2:58 ` [PATCH 1/2] tracing: Fix lockdep warning in global_clock() Steven Rostedt
  2010-03-30  2:58 ` [PATCH 2/2] ring-buffer: Add missing unlock Steven Rostedt
@ 2010-04-02 20:07 ` Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2010-04-02 20:07 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Andrew Morton, Frederic Weisbecker


* Steven Rostedt <rostedt@goodmis.org> wrote:

> Ingo,
> 
> I rebased my branch against yours and removed the module patch since it 
> looks like it is no longer urgent. I moved it over to my core branch along 
> with a fix to the compile error you saw with it. I'll be pushing that later 
> this week.
> 
> These two patchs still should go into 34.
> 
> Please pull the latest tip/tracing/urgent tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/tracing/urgent
> 
> 
> Julia Lawall (1):
>       ring-buffer: Add missing unlock
> 
> Li Zefan (1):
>       tracing: Fix lockdep warning in global_clock()
> 
> ----
>  kernel/trace/ring_buffer.c |    8 +++++---
>  kernel/trace/trace_clock.c |    4 ++--
>  2 files changed, 7 insertions(+), 5 deletions(-)

Pulled, thanks Steve!

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-02 20:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-30  2:58 [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes Steven Rostedt
2010-03-30  2:58 ` [PATCH 1/2] tracing: Fix lockdep warning in global_clock() Steven Rostedt
2010-03-30  2:58 ` [PATCH 2/2] ring-buffer: Add missing unlock Steven Rostedt
2010-04-02 20:07 ` [PATCH 0/2] [GIT PULL][v2.6.34] tracing: fixes Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome