* [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular
@ 2015-08-25 15:23 Paul Gortmaker
2015-08-25 16:29 ` Josh Triplett
0 siblings, 1 reply; 5+ messages in thread
From: Paul Gortmaker @ 2015-08-25 15:23 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Paul E. McKenney, Josh Triplett, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan
The Kconfig currently controlling compilation of this code is:
init/Kconfig:config TREE_RCU_TRACE
init/Kconfig: def_bool RCU_TRACE && ( TREE_RCU || PREEMPT_RCU )
...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the file there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. We could
consider moving this to an earlier initcall if desired.
We don't replace module.h with init.h since the file already has that.
We also delete the moduleparam.h include that is left over from
commit 64db4cfff99c04cd5f550357edcc8780f96b54a2 (""Tree RCU": scalable
classic RCU implementation") since it is not needed here either.
We leave some tags like MODULE_AUTHOR for documentation purposes.
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/kernel/rcu/tree_trace.c b/kernel/rcu/tree_trace.c
index 6fc4c5ff3bb5..e8a0a11e8dd7 100644
--- a/kernel/rcu/tree_trace.c
+++ b/kernel/rcu/tree_trace.c
@@ -33,9 +33,7 @@
#include <linux/sched.h>
#include <linux/atomic.h>
#include <linux/bitops.h>
-#include <linux/module.h>
#include <linux/completion.h>
-#include <linux/moduleparam.h>
#include <linux/percpu.h>
#include <linux/notifier.h>
#include <linux/cpu.h>
@@ -487,16 +485,10 @@ free_out:
debugfs_remove_recursive(rcudir);
return 1;
}
+device_initcall(rcutree_trace_init);
-static void __exit rcutree_trace_cleanup(void)
-{
- debugfs_remove_recursive(rcudir);
-}
-
-
-module_init(rcutree_trace_init);
-module_exit(rcutree_trace_cleanup);
-
+/*
MODULE_AUTHOR("Paul E. McKenney");
MODULE_DESCRIPTION("Read-Copy Update tracing for hierarchical implementation");
MODULE_LICENSE("GPL");
+*/
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular 2015-08-25 15:23 [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular Paul Gortmaker @ 2015-08-25 16:29 ` Josh Triplett 2015-08-25 18:11 ` Paul Gortmaker 0 siblings, 1 reply; 5+ messages in thread From: Josh Triplett @ 2015-08-25 16:29 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel, Paul E. McKenney, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan On Tue, Aug 25, 2015 at 11:23:17AM -0400, Paul Gortmaker wrote: > The Kconfig currently controlling compilation of this code is: > > init/Kconfig:config TREE_RCU_TRACE > init/Kconfig: def_bool RCU_TRACE && ( TREE_RCU || PREEMPT_RCU ) > > ...meaning that it currently is not being built as a module by anyone. > > Lets remove the modular code that is essentially orphaned, so that > when reading the file there is no doubt it is builtin-only. > > Since module_init translates to device_initcall in the non-modular > case, the init ordering remains unchanged with this commit. We could > consider moving this to an earlier initcall if desired. > > We don't replace module.h with init.h since the file already has that. > We also delete the moduleparam.h include that is left over from > commit 64db4cfff99c04cd5f550357edcc8780f96b54a2 (""Tree RCU": scalable > classic RCU implementation") since it is not needed here either. > > We leave some tags like MODULE_AUTHOR for documentation purposes. > > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> > Cc: Josh Triplett <josh@joshtriplett.org> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > Cc: Lai Jiangshan <jiangshanlai@gmail.com> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Seems reasonable, though leaving the MODULE_* metadata commented out at the end seems odd. I'd suggest using the DESCRIPTION to update the comment at the top (which is actually outdated and needs s/classic/hierarchical/), dropping the MODULE_LICENSE (redundant with the license header), and changing "MODULE_AUTHOR" into an "Author:" under the copyright. With that: Reviewed-by: Josh Triplett <josh@joshtriplett.org> > diff --git a/kernel/rcu/tree_trace.c b/kernel/rcu/tree_trace.c > index 6fc4c5ff3bb5..e8a0a11e8dd7 100644 > --- a/kernel/rcu/tree_trace.c > +++ b/kernel/rcu/tree_trace.c > @@ -33,9 +33,7 @@ > #include <linux/sched.h> > #include <linux/atomic.h> > #include <linux/bitops.h> > -#include <linux/module.h> > #include <linux/completion.h> > -#include <linux/moduleparam.h> > #include <linux/percpu.h> > #include <linux/notifier.h> > #include <linux/cpu.h> > @@ -487,16 +485,10 @@ free_out: > debugfs_remove_recursive(rcudir); > return 1; > } > +device_initcall(rcutree_trace_init); > > -static void __exit rcutree_trace_cleanup(void) > -{ > - debugfs_remove_recursive(rcudir); > -} > - > - > -module_init(rcutree_trace_init); > -module_exit(rcutree_trace_cleanup); > - > +/* > MODULE_AUTHOR("Paul E. McKenney"); > MODULE_DESCRIPTION("Read-Copy Update tracing for hierarchical implementation"); > MODULE_LICENSE("GPL"); > +*/ > -- > 2.5.0 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular 2015-08-25 16:29 ` Josh Triplett @ 2015-08-25 18:11 ` Paul Gortmaker 2015-08-25 22:37 ` Paul E. McKenney 0 siblings, 1 reply; 5+ messages in thread From: Paul Gortmaker @ 2015-08-25 18:11 UTC (permalink / raw) To: Josh Triplett Cc: linux-kernel, Paul E. McKenney, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan [Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular] On 25/08/2015 (Tue 09:29) Josh Triplett wrote: > On Tue, Aug 25, 2015 at 11:23:17AM -0400, Paul Gortmaker wrote: > > The Kconfig currently controlling compilation of this code is: > > > > init/Kconfig:config TREE_RCU_TRACE > > init/Kconfig: def_bool RCU_TRACE && ( TREE_RCU || PREEMPT_RCU ) > > > > ...meaning that it currently is not being built as a module by anyone. > > > > Lets remove the modular code that is essentially orphaned, so that > > when reading the file there is no doubt it is builtin-only. > > > > Since module_init translates to device_initcall in the non-modular > > case, the init ordering remains unchanged with this commit. We could > > consider moving this to an earlier initcall if desired. > > > > We don't replace module.h with init.h since the file already has that. > > We also delete the moduleparam.h include that is left over from > > commit 64db4cfff99c04cd5f550357edcc8780f96b54a2 (""Tree RCU": scalable > > classic RCU implementation") since it is not needed here either. > > > > We leave some tags like MODULE_AUTHOR for documentation purposes. > > > > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> > > Cc: Josh Triplett <josh@joshtriplett.org> > > Cc: Steven Rostedt <rostedt@goodmis.org> > > Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > > Cc: Lai Jiangshan <jiangshanlai@gmail.com> > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > > Seems reasonable, though leaving the MODULE_* metadata commented out at > the end seems odd. I'd suggest using the DESCRIPTION to update the That was largely driven by the desire to make as minimalist change as possible... > comment at the top (which is actually outdated and needs > s/classic/hierarchical/), dropping the MODULE_LICENSE (redundant with > the license header), and changing "MODULE_AUTHOR" into an "Author:" > under the copyright. ...but I can also do it that way too; fine by me. I'll wait a bit to give Paul a chance to comment before resending, in case he also wants some changes. P. -- > > With that: > Reviewed-by: Josh Triplett <josh@joshtriplett.org> > > > diff --git a/kernel/rcu/tree_trace.c b/kernel/rcu/tree_trace.c > > index 6fc4c5ff3bb5..e8a0a11e8dd7 100644 > > --- a/kernel/rcu/tree_trace.c > > +++ b/kernel/rcu/tree_trace.c > > @@ -33,9 +33,7 @@ > > #include <linux/sched.h> > > #include <linux/atomic.h> > > #include <linux/bitops.h> > > -#include <linux/module.h> > > #include <linux/completion.h> > > -#include <linux/moduleparam.h> > > #include <linux/percpu.h> > > #include <linux/notifier.h> > > #include <linux/cpu.h> > > @@ -487,16 +485,10 @@ free_out: > > debugfs_remove_recursive(rcudir); > > return 1; > > } > > +device_initcall(rcutree_trace_init); > > > > -static void __exit rcutree_trace_cleanup(void) > > -{ > > - debugfs_remove_recursive(rcudir); > > -} > > - > > - > > -module_init(rcutree_trace_init); > > -module_exit(rcutree_trace_cleanup); > > - > > +/* > > MODULE_AUTHOR("Paul E. McKenney"); > > MODULE_DESCRIPTION("Read-Copy Update tracing for hierarchical implementation"); > > MODULE_LICENSE("GPL"); > > +*/ > > -- > > 2.5.0 > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular 2015-08-25 18:11 ` Paul Gortmaker @ 2015-08-25 22:37 ` Paul E. McKenney 2015-08-26 1:36 ` Paul Gortmaker 0 siblings, 1 reply; 5+ messages in thread From: Paul E. McKenney @ 2015-08-25 22:37 UTC (permalink / raw) To: Paul Gortmaker Cc: Josh Triplett, linux-kernel, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan On Tue, Aug 25, 2015 at 02:11:09PM -0400, Paul Gortmaker wrote: > [Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular] On 25/08/2015 (Tue 09:29) Josh Triplett wrote: > > > On Tue, Aug 25, 2015 at 11:23:17AM -0400, Paul Gortmaker wrote: > > > The Kconfig currently controlling compilation of this code is: > > > > > > init/Kconfig:config TREE_RCU_TRACE > > > init/Kconfig: def_bool RCU_TRACE && ( TREE_RCU || PREEMPT_RCU ) > > > > > > ...meaning that it currently is not being built as a module by anyone. > > > > > > Lets remove the modular code that is essentially orphaned, so that > > > when reading the file there is no doubt it is builtin-only. > > > > > > Since module_init translates to device_initcall in the non-modular > > > case, the init ordering remains unchanged with this commit. We could > > > consider moving this to an earlier initcall if desired. > > > > > > We don't replace module.h with init.h since the file already has that. > > > We also delete the moduleparam.h include that is left over from > > > commit 64db4cfff99c04cd5f550357edcc8780f96b54a2 (""Tree RCU": scalable > > > classic RCU implementation") since it is not needed here either. > > > > > > We leave some tags like MODULE_AUTHOR for documentation purposes. > > > > > > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> > > > Cc: Josh Triplett <josh@joshtriplett.org> > > > Cc: Steven Rostedt <rostedt@goodmis.org> > > > Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > > > Cc: Lai Jiangshan <jiangshanlai@gmail.com> > > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > > > > Seems reasonable, though leaving the MODULE_* metadata commented out at > > the end seems odd. I'd suggest using the DESCRIPTION to update the > > That was largely driven by the desire to make as minimalist change as > possible... This would be for v4.4, so getting rid of the three "MODULE_*" lines at the end makes sense, as does moving any needed info to the comment block at the beginning of the file. > > comment at the top (which is actually outdated and needs > > s/classic/hierarchical/), dropping the MODULE_LICENSE (redundant with > > the license header), and changing "MODULE_AUTHOR" into an "Author:" > > under the copyright. > > ...but I can also do it that way too; fine by me. I'll wait a bit to > give Paul a chance to comment before resending, in case he also wants > some changes. The "classic" is indeed obsolete, may as well change it while we are at it. I was concerned about the THIS_MODULE instances, but this appears to be defined even for non-module builds, so should be OK. So please do send a patch with the changes Josh called out. Thanx, Paul ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular 2015-08-25 22:37 ` Paul E. McKenney @ 2015-08-26 1:36 ` Paul Gortmaker 0 siblings, 0 replies; 5+ messages in thread From: Paul Gortmaker @ 2015-08-26 1:36 UTC (permalink / raw) To: Paul E. McKenney Cc: Josh Triplett, linux-kernel, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan [Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular] On 25/08/2015 (Tue 15:37) Paul E. McKenney wrote: > On Tue, Aug 25, 2015 at 02:11:09PM -0400, Paul Gortmaker wrote: > > [Re: [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular] On 25/08/2015 (Tue 09:29) Josh Triplett wrote: > > > > > On Tue, Aug 25, 2015 at 11:23:17AM -0400, Paul Gortmaker wrote: > > > > The Kconfig currently controlling compilation of this code is: > > > > > > > > init/Kconfig:config TREE_RCU_TRACE > > > > init/Kconfig: def_bool RCU_TRACE && ( TREE_RCU || PREEMPT_RCU ) > > > > > > > > ...meaning that it currently is not being built as a module by anyone. > > > > > > > > Lets remove the modular code that is essentially orphaned, so that > > > > when reading the file there is no doubt it is builtin-only. > > > > > > > > Since module_init translates to device_initcall in the non-modular > > > > case, the init ordering remains unchanged with this commit. We could > > > > consider moving this to an earlier initcall if desired. > > > > > > > > We don't replace module.h with init.h since the file already has that. > > > > We also delete the moduleparam.h include that is left over from > > > > commit 64db4cfff99c04cd5f550357edcc8780f96b54a2 (""Tree RCU": scalable > > > > classic RCU implementation") since it is not needed here either. > > > > > > > > We leave some tags like MODULE_AUTHOR for documentation purposes. > > > > > > > > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> > > > > Cc: Josh Triplett <josh@joshtriplett.org> > > > > Cc: Steven Rostedt <rostedt@goodmis.org> > > > > Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > > > > Cc: Lai Jiangshan <jiangshanlai@gmail.com> > > > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > > > > > > Seems reasonable, though leaving the MODULE_* metadata commented out at > > > the end seems odd. I'd suggest using the DESCRIPTION to update the > > > > That was largely driven by the desire to make as minimalist change as > > possible... > > This would be for v4.4, so getting rid of the three "MODULE_*" lines > at the end makes sense, as does moving any needed info to the comment > block at the beginning of the file. OK, no problem. > > > > comment at the top (which is actually outdated and needs > > > s/classic/hierarchical/), dropping the MODULE_LICENSE (redundant with > > > the license header), and changing "MODULE_AUTHOR" into an "Author:" > > > under the copyright. > > > > ...but I can also do it that way too; fine by me. I'll wait a bit to > > give Paul a chance to comment before resending, in case he also wants > > some changes. > > The "classic" is indeed obsolete, may as well change it while we are > at it. I was concerned about the THIS_MODULE instances, but this appears > to be defined even for non-module builds, so should be OK. Ah, ye of little faith. I dealt with THIS_MODULE in f5016932, now over four years ago (gasp!) > > So please do send a patch with the changes Josh called out. Will do. Thanks, Paul. -- > > Thanx, Paul > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-26 1:36 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-08-25 15:23 [PATCH] kernel: make rcu/tree_trace.c explicitly non-modular Paul Gortmaker 2015-08-25 16:29 ` Josh Triplett 2015-08-25 18:11 ` Paul Gortmaker 2015-08-25 22:37 ` Paul E. McKenney 2015-08-26 1:36 ` Paul Gortmaker
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox