RCU preempt updates
Steven Rostedt
reviewercover RCU preempt updates
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
Steven Rostedt
reviewerPATCH 1/2 rcu: just rename call_rcu_bh instead of making it a macro
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.
--- include/linux/rcupreempt.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
include/linux/rcupreempt.h +7 -1
@@ -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.
Re: [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro
Quoted 5 lines · Steven Rostedt
Seems that I found a box that has a config that passes
call_rcu_bhas a function pointer (seenet/sctp/sm_make_chunk.c), so declaring thecall_rcu_bhhas a macro function isn't good enough.This patch makes it just another name of
call_rcufor rcupreempt.
Looks good!
Quoted 27 lines
Signed-off-by Steven Rostedt <[email protected]>--- include/linux/rcupreempt.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)Index:
linux-compile.git/include/linux/rcupreempt.h
===================================================================include/linux/rcupreempt.h +7
-1@@ -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. Signature · 1 line
--
Ingo Molnar
AppliedRe: [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro
Quoted 10 lines · Paul E. McKenney
Quoted 5 lines · Steven Rostedt
Seems that I found a box that has a config that passes
call_rcu_bhas a function pointer (seenet/sctp/sm_make_chunk.c), so declaring thecall_rcu_bhhas a macro function isn't good enough.This patch makes it just another name of
call_rcufor rcupreempt.Looks good!
Reviewed-by Paul E. McKenney <[email protected]>
applied to tip/core/rcu - thanks!
Ingo
Steven Rostedt
reviewerPATCH 2/2 rcu: trace fix possible mem-leak
In reply to Steven RostedtIn 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.
--- kernel/rcupreempt_trace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/rcupreempt_trace.c +6 -1
@@ -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)
Re: [PATCH 2/2] rcu: trace fix possible mem-leak
Quoted 4 lines · Steven Rostedt
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!
Quoted 29 lines
Signed-off-by Steven Rostedt <[email protected]>--- kernel/rcupreempt_trace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)Index:
linux-compile.git/kernel/rcupreempt_trace.c
===================================================================kernel/rcupreempt_trace.c +6
-1@@ -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)Signature · 1 line
--
Ingo Molnar
AppliedRe: [PATCH 2/2] rcu: trace fix possible mem-leak
Quoted 9 lines · Paul E. McKenney
Quoted 4 lines · Steven Rostedt
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 <[email protected]>
applied to tip/core/rcu - thanks.
Ingo