diff mbox

[tip/core/rcu,3/9] rcu: Control rcutorture startup from kernel boot parameters

Message ID 1321388885-11211-3-git-send-email-paulmck@linux.vnet.ibm.com
State Accepted
Commit bb3bf7052de520f2d21a1275e95fac7a84d89e4c
Headers show

Commit Message

Paul E. McKenney Nov. 15, 2011, 8:27 p.m. UTC
From: Paul E. McKenney <paul.mckenney@linaro.org>

Currently, if rcutorture is built into the kernel, it must be manually
started or started from an init script.  This is inconvenient for
automated KVM testing, where it is good to be able to fully control
rcutorture execution from the kernel parameters.  This patch therefore
adds a module parameter named "rcutorture_runnable" that defaults
to zero ("don't start automatically"), but which can be set to one
to cause rcutorture to start up immediately during boot.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutorture.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Josh Triplett Nov. 15, 2011, 9:49 p.m. UTC | #1
On Tue, Nov 15, 2011 at 12:27:59PM -0800, Paul E. McKenney wrote:
> From: Paul E. McKenney <paul.mckenney@linaro.org>
> 
> Currently, if rcutorture is built into the kernel, it must be manually
> started or started from an init script.  This is inconvenient for
> automated KVM testing, where it is good to be able to fully control
> rcutorture execution from the kernel parameters.  This patch therefore
> adds a module parameter named "rcutorture_runnable" that defaults
> to zero ("don't start automatically"), but which can be set to one
> to cause rcutorture to start up immediately during boot.
> 
> Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---
>  kernel/rcutorture.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
> index 41802be..fd7a0e6 100644
> --- a/kernel/rcutorture.c
> +++ b/kernel/rcutorture.c
> @@ -164,6 +164,8 @@ static int stutter_pause_test;
>  #define RCUTORTURE_RUNNABLE_INIT 0
>  #endif
>  int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
> +module_param(rcutorture_runnable, int, 0444);
> +MODULE_PARM_DESC(rcutorture_runnable, "Start rcutorture at boot");

Perhaps this should become a bool rather than an int, so that the kernel
would recognize various variations on the parameter value, such as "on"
or "true".

- Josh Triplett
Paul E. McKenney Nov. 16, 2011, 8:38 p.m. UTC | #2
On Tue, Nov 15, 2011 at 01:49:32PM -0800, Josh Triplett wrote:
> On Tue, Nov 15, 2011 at 12:27:59PM -0800, Paul E. McKenney wrote:
> > From: Paul E. McKenney <paul.mckenney@linaro.org>
> > 
> > Currently, if rcutorture is built into the kernel, it must be manually
> > started or started from an init script.  This is inconvenient for
> > automated KVM testing, where it is good to be able to fully control
> > rcutorture execution from the kernel parameters.  This patch therefore
> > adds a module parameter named "rcutorture_runnable" that defaults
> > to zero ("don't start automatically"), but which can be set to one
> > to cause rcutorture to start up immediately during boot.
> > 
> > Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > ---
> >  kernel/rcutorture.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
> > index 41802be..fd7a0e6 100644
> > --- a/kernel/rcutorture.c
> > +++ b/kernel/rcutorture.c
> > @@ -164,6 +164,8 @@ static int stutter_pause_test;
> >  #define RCUTORTURE_RUNNABLE_INIT 0
> >  #endif
> >  int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
> > +module_param(rcutorture_runnable, int, 0444);
> > +MODULE_PARM_DESC(rcutorture_runnable, "Start rcutorture at boot");
> 
> Perhaps this should become a bool rather than an int, so that the kernel
> would recognize various variations on the parameter value, such as "on"
> or "true".

I had a funny feeling that I would be needing other values to do things
like say at what phase of boot the test was to start.

But if no need for this sort of function appears in the next while, then
switching to bool would indeed make a lot of sense.

							Thanx, Paul
Josh Triplett Nov. 16, 2011, 10:17 p.m. UTC | #3
On Wed, Nov 16, 2011 at 12:38:51PM -0800, Paul E. McKenney wrote:
> On Tue, Nov 15, 2011 at 01:49:32PM -0800, Josh Triplett wrote:
> > On Tue, Nov 15, 2011 at 12:27:59PM -0800, Paul E. McKenney wrote:
> > > From: Paul E. McKenney <paul.mckenney@linaro.org>
> > > 
> > > Currently, if rcutorture is built into the kernel, it must be manually
> > > started or started from an init script.  This is inconvenient for
> > > automated KVM testing, where it is good to be able to fully control
> > > rcutorture execution from the kernel parameters.  This patch therefore
> > > adds a module parameter named "rcutorture_runnable" that defaults
> > > to zero ("don't start automatically"), but which can be set to one
> > > to cause rcutorture to start up immediately during boot.
> > > 
> > > Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > ---
> > >  kernel/rcutorture.c |    2 ++
> > >  1 files changed, 2 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
> > > index 41802be..fd7a0e6 100644
> > > --- a/kernel/rcutorture.c
> > > +++ b/kernel/rcutorture.c
> > > @@ -164,6 +164,8 @@ static int stutter_pause_test;
> > >  #define RCUTORTURE_RUNNABLE_INIT 0
> > >  #endif
> > >  int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
> > > +module_param(rcutorture_runnable, int, 0444);
> > > +MODULE_PARM_DESC(rcutorture_runnable, "Start rcutorture at boot");
> > 
> > Perhaps this should become a bool rather than an int, so that the kernel
> > would recognize various variations on the parameter value, such as "on"
> > or "true".
> 
> I had a funny feeling that I would be needing other values to do things
> like say at what phase of boot the test was to start.
> 
> But if no need for this sort of function appears in the next while, then
> switching to bool would indeed make a lot of sense.

Ah, fair enough.

- Josh Triplett
diff mbox

Patch

diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 41802be..fd7a0e6 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -164,6 +164,8 @@  static int stutter_pause_test;
 #define RCUTORTURE_RUNNABLE_INIT 0
 #endif
 int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
+module_param(rcutorture_runnable, int, 0444);
+MODULE_PARM_DESC(rcutorture_runnable, "Start rcutorture at boot");
 
 #if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU)
 #define rcu_can_boost() 1