public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2]  RCU preempt updates
@ 2008-07-30 18:20 Steven Rostedt
  2008-07-30 18:20 ` [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro Steven Rostedt
  2008-07-30 18:20 ` [PATCH 2/2] rcu: trace fix possible mem-leak Steven Rostedt
  0 siblings, 2 replies; 7+ messages in thread
From: Steven Rostedt @ 2008-07-30 18:20 UTC (permalink / raw)
  To: Paul E. McKenney, Ingo Molnar, Peter Zijlstra, Thomas Gleixner,
	Andrew Morton, linux-kernel

The following patches have been sitting in the RT tree for some time.
They have been waiting for both RCU preempt and RCU preempt tracing
to get into mainline.

Since those are now in mainline, it is time to send in these patches.

-- Steve


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

* [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro
  2008-07-30 18:20 [PATCH 0/2] RCU preempt updates Steven Rostedt
@ 2008-07-30 18:20 ` Steven Rostedt
  2008-08-01 21:11   ` Paul E. McKenney
  2008-07-30 18:20 ` [PATCH 2/2] rcu: trace fix possible mem-leak Steven Rostedt
  1 sibling, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2008-07-30 18:20 UTC (permalink / raw)
  To: Paul E. McKenney, Ingo Molnar, Peter Zijlstra, Thomas Gleixner,
	Andrew Morton, linux-kernel
  Cc: Steven Rostedt

[-- Attachment #1: call_rcu_bh-rename-of-call_rcu.patch --]
[-- Type: text/plain, Size: 1158 bytes --]

Seems that I found a box that has a config that passes call_rcu_bh as a
function pointer (see net/sctp/sm_make_chunk.c), so declaring the
call_rcu_bh has a macro function isn't good enough.

This patch makes it just another name of call_rcu for rcupreempt.

Signed-off-by: Steven Rostedt <srostedt@redhat.org>

---
 include/linux/rcupreempt.h |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: linux-compile.git/include/linux/rcupreempt.h
===================================================================
--- linux-compile.git.orig/include/linux/rcupreempt.h	2008-07-30 13:56:28.000000000 -0400
+++ linux-compile.git/include/linux/rcupreempt.h	2008-07-30 13:57:57.000000000 -0400
@@ -57,7 +57,13 @@ static inline void rcu_qsctr_inc(int cpu
 	rdssp->sched_qs++;
 }
 #define rcu_bh_qsctr_inc(cpu)
-#define call_rcu_bh(head, rcu) call_rcu(head, rcu)
+
+/*
+ * Someone might want to pass call_rcu_bh as a function pointer.
+ * So this needs to just be a rename and not a macro function.
+ *  (no parentheses)
+ */
+#define call_rcu_bh	 	call_rcu
 
 /**
  * call_rcu_sched - Queue RCU callback for invocation after sched grace period.

-- 

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

* [PATCH 2/2] rcu: trace fix possible mem-leak
  2008-07-30 18:20 [PATCH 0/2] RCU preempt updates Steven Rostedt
  2008-07-30 18:20 ` [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro Steven Rostedt
@ 2008-07-30 18:20 ` Steven Rostedt
  2008-08-01 21:11   ` Paul E. McKenney
  1 sibling, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2008-07-30 18:20 UTC (permalink / raw)
  To: Paul E. McKenney, Ingo Molnar, Peter Zijlstra, Thomas Gleixner,
	Andrew Morton, linux-kernel
  Cc: Steven Rostedt

[-- Attachment #1: rcu-trace-fix-free.patch --]
[-- Type: text/plain, Size: 1056 bytes --]

In the initialization of the RCU trace module, if
rcupreempt_debugfs_init() fails, we never free the the trace buffer.

This patch frees the trace buffer in case the debugfs fails.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 kernel/rcupreempt_trace.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux-compile.git/kernel/rcupreempt_trace.c
===================================================================
--- linux-compile.git.orig/kernel/rcupreempt_trace.c	2008-07-15 23:55:47.000000000 -0400
+++ linux-compile.git/kernel/rcupreempt_trace.c	2008-07-30 13:58:41.000000000 -0400
@@ -308,11 +308,16 @@ out:
 
 static int __init rcupreempt_trace_init(void)
 {
+	int ret;
+
 	mutex_init(&rcupreempt_trace_mutex);
 	rcupreempt_trace_buf = kmalloc(RCUPREEMPT_TRACE_BUF_SIZE, GFP_KERNEL);
 	if (!rcupreempt_trace_buf)
 		return 1;
-	return rcupreempt_debugfs_init();
+	ret = rcupreempt_debugfs_init();
+	if (ret)
+		kfree(rcupreempt_trace_buf);
+	return ret;
 }
 
 static void __exit rcupreempt_trace_cleanup(void)

-- 

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

* Re: [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro
  2008-07-30 18:20 ` [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro Steven Rostedt
@ 2008-08-01 21:11   ` Paul E. McKenney
  2008-08-15 15:54     ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2008-08-01 21:11 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Ingo Molnar, Peter Zijlstra, Thomas Gleixner, Andrew Morton,
	linux-kernel, Steven Rostedt

On Wed, Jul 30, 2008 at 02:20:54PM -0400, Steven Rostedt wrote:
> Seems that I found a box that has a config that passes call_rcu_bh as a
> function pointer (see net/sctp/sm_make_chunk.c), so declaring the
> call_rcu_bh has a macro function isn't good enough.
> 
> This patch makes it just another name of call_rcu for rcupreempt.

Looks good!

Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> Signed-off-by: Steven Rostedt <srostedt@redhat.org>
> 
> ---
>  include/linux/rcupreempt.h |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> Index: linux-compile.git/include/linux/rcupreempt.h
> ===================================================================
> --- linux-compile.git.orig/include/linux/rcupreempt.h	2008-07-30 13:56:28.000000000 -0400
> +++ linux-compile.git/include/linux/rcupreempt.h	2008-07-30 13:57:57.000000000 -0400
> @@ -57,7 +57,13 @@ static inline void rcu_qsctr_inc(int cpu
>  	rdssp->sched_qs++;
>  }
>  #define rcu_bh_qsctr_inc(cpu)
> -#define call_rcu_bh(head, rcu) call_rcu(head, rcu)
> +
> +/*
> + * Someone might want to pass call_rcu_bh as a function pointer.
> + * So this needs to just be a rename and not a macro function.
> + *  (no parentheses)
> + */
> +#define call_rcu_bh	 	call_rcu
> 
>  /**
>   * call_rcu_sched - Queue RCU callback for invocation after sched grace period.
> 
> -- 

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

* Re: [PATCH 2/2] rcu: trace fix possible mem-leak
  2008-07-30 18:20 ` [PATCH 2/2] rcu: trace fix possible mem-leak Steven Rostedt
@ 2008-08-01 21:11   ` Paul E. McKenney
  2008-08-15 15:55     ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2008-08-01 21:11 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Ingo Molnar, Peter Zijlstra, Thomas Gleixner, Andrew Morton,
	linux-kernel, Steven Rostedt

On Wed, Jul 30, 2008 at 02:20:55PM -0400, Steven Rostedt wrote:
> In the initialization of the RCU trace module, if
> rcupreempt_debugfs_init() fails, we never free the the trace buffer.
> 
> This patch frees the trace buffer in case the debugfs fails.

Looks good as well!

Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
> ---
>  kernel/rcupreempt_trace.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> Index: linux-compile.git/kernel/rcupreempt_trace.c
> ===================================================================
> --- linux-compile.git.orig/kernel/rcupreempt_trace.c	2008-07-15 23:55:47.000000000 -0400
> +++ linux-compile.git/kernel/rcupreempt_trace.c	2008-07-30 13:58:41.000000000 -0400
> @@ -308,11 +308,16 @@ out:
> 
>  static int __init rcupreempt_trace_init(void)
>  {
> +	int ret;
> +
>  	mutex_init(&rcupreempt_trace_mutex);
>  	rcupreempt_trace_buf = kmalloc(RCUPREEMPT_TRACE_BUF_SIZE, GFP_KERNEL);
>  	if (!rcupreempt_trace_buf)
>  		return 1;
> -	return rcupreempt_debugfs_init();
> +	ret = rcupreempt_debugfs_init();
> +	if (ret)
> +		kfree(rcupreempt_trace_buf);
> +	return ret;
>  }
> 
>  static void __exit rcupreempt_trace_cleanup(void)
> 
> -- 

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

* Re: [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro
  2008-08-01 21:11   ` Paul E. McKenney
@ 2008-08-15 15:54     ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-08-15 15:54 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Steven Rostedt, Peter Zijlstra, Thomas Gleixner, Andrew Morton,
	linux-kernel, Steven Rostedt


* Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:

> On Wed, Jul 30, 2008 at 02:20:54PM -0400, Steven Rostedt wrote:
> > Seems that I found a box that has a config that passes call_rcu_bh as a
> > function pointer (see net/sctp/sm_make_chunk.c), so declaring the
> > call_rcu_bh has a macro function isn't good enough.
> > 
> > This patch makes it just another name of call_rcu for rcupreempt.
> 
> Looks good!
> 
> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

applied to tip/core/rcu - thanks!

	Ingo

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

* Re: [PATCH 2/2] rcu: trace fix possible mem-leak
  2008-08-01 21:11   ` Paul E. McKenney
@ 2008-08-15 15:55     ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-08-15 15:55 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Steven Rostedt, Peter Zijlstra, Thomas Gleixner, Andrew Morton,
	linux-kernel, Steven Rostedt


* Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:

> On Wed, Jul 30, 2008 at 02:20:55PM -0400, Steven Rostedt wrote:
> > In the initialization of the RCU trace module, if
> > rcupreempt_debugfs_init() fails, we never free the the trace buffer.
> > 
> > This patch frees the trace buffer in case the debugfs fails.
> 
> Looks good as well!
> 
> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

applied to tip/core/rcu - thanks.

	Ingo

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

end of thread, other threads:[~2008-08-15 15:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30 18:20 [PATCH 0/2] RCU preempt updates Steven Rostedt
2008-07-30 18:20 ` [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro Steven Rostedt
2008-08-01 21:11   ` Paul E. McKenney
2008-08-15 15:54     ` Ingo Molnar
2008-07-30 18:20 ` [PATCH 2/2] rcu: trace fix possible mem-leak Steven Rostedt
2008-08-01 21:11   ` Paul E. McKenney
2008-08-15 15:55     ` Ingo Molnar

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