linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rcutorture: don't mark torture_init_{begin,end} with __init
@ 2014-04-28 19:03 Will Deacon
  2014-04-28 20:13 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2014-04-28 19:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Will Deacon, Paul E. McKenney, Josh Triplett

By the time rcutorture is initialised via its module_init callback, the
.init.text section of torture.ko has already been freed, so the calls to
torture_init{begin,end} end up branching to junk.

This patch removes the __init annotations from torture_init_{begin,end}
to make sure the code is there when we want to call it.

Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---

Just lost a day to this -- I was sure my static relocation handling must
be to blame!

 kernel/torture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/torture.c b/kernel/torture.c
index acc9afc2f26e..d5ef30ce6eb5 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -596,7 +596,7 @@ static void torture_stutter_cleanup(void)
  * The runnable parameter points to a flag that controls whether or not
  * the test is currently runnable.  If there is no such flag, pass in NULL.
  */
-void __init torture_init_begin(char *ttype, bool v, int *runnable)
+void torture_init_begin(char *ttype, bool v, int *runnable)
 {
 	mutex_lock(&fullstop_mutex);
 	torture_type = ttype;
@@ -610,7 +610,7 @@ EXPORT_SYMBOL_GPL(torture_init_begin);
 /*
  * Tell the torture module that initialization is complete.
  */
-void __init torture_init_end(void)
+void torture_init_end(void)
 {
 	mutex_unlock(&fullstop_mutex);
 	register_reboot_notifier(&torture_shutdown_nb);
-- 
1.9.2


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

* Re: [PATCH] rcutorture: don't mark torture_init_{begin,end} with __init
  2014-04-28 19:03 [PATCH] rcutorture: don't mark torture_init_{begin,end} with __init Will Deacon
@ 2014-04-28 20:13 ` Paul E. McKenney
  2014-04-29  8:38   ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2014-04-28 20:13 UTC (permalink / raw)
  To: Will Deacon; +Cc: linux-kernel, Josh Triplett

On Mon, Apr 28, 2014 at 08:03:35PM +0100, Will Deacon wrote:
> By the time rcutorture is initialised via its module_init callback, the
> .init.text section of torture.ko has already been freed, so the calls to
> torture_init{begin,end} end up branching to junk.
> 
> This patch removes the __init annotations from torture_init_{begin,end}
> to make sure the code is there when we want to call it.
> 
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Good catch, and apologies for the wasted day, but someone beat you to
this.  By only 12 days, which is a bit surprising given how long this
has been lurking.

							Thanx, Paul

> ---
> 
> Just lost a day to this -- I was sure my static relocation handling must
> be to blame!
> 
>  kernel/torture.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/torture.c b/kernel/torture.c
> index acc9afc2f26e..d5ef30ce6eb5 100644
> --- a/kernel/torture.c
> +++ b/kernel/torture.c
> @@ -596,7 +596,7 @@ static void torture_stutter_cleanup(void)
>   * The runnable parameter points to a flag that controls whether or not
>   * the test is currently runnable.  If there is no such flag, pass in NULL.
>   */
> -void __init torture_init_begin(char *ttype, bool v, int *runnable)
> +void torture_init_begin(char *ttype, bool v, int *runnable)
>  {
>  	mutex_lock(&fullstop_mutex);
>  	torture_type = ttype;
> @@ -610,7 +610,7 @@ EXPORT_SYMBOL_GPL(torture_init_begin);
>  /*
>   * Tell the torture module that initialization is complete.
>   */
> -void __init torture_init_end(void)
> +void torture_init_end(void)
>  {
>  	mutex_unlock(&fullstop_mutex);
>  	register_reboot_notifier(&torture_shutdown_nb);
> -- 
> 1.9.2
> 


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

* Re: [PATCH] rcutorture: don't mark torture_init_{begin,end} with __init
  2014-04-28 20:13 ` Paul E. McKenney
@ 2014-04-29  8:38   ` Will Deacon
  0 siblings, 0 replies; 3+ messages in thread
From: Will Deacon @ 2014-04-29  8:38 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: linux-kernel@vger.kernel.org, Josh Triplett

On Mon, Apr 28, 2014 at 09:13:04PM +0100, Paul E. McKenney wrote:
> On Mon, Apr 28, 2014 at 08:03:35PM +0100, Will Deacon wrote:
> > By the time rcutorture is initialised via its module_init callback, the
> > .init.text section of torture.ko has already been freed, so the calls to
> > torture_init{begin,end} end up branching to junk.
> > 
> > This patch removes the __init annotations from torture_init_{begin,end}
> > to make sure the code is there when we want to call it.
> > 
> > Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > Cc: Josh Triplett <josh@joshtriplett.org>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
> 
> Good catch, and apologies for the wasted day, but someone beat you to
> this.  By only 12 days, which is a bit surprising given how long this
> has been lurking.

Oh well, at least it's getting fixed!

Will

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

end of thread, other threads:[~2014-04-29  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 19:03 [PATCH] rcutorture: don't mark torture_init_{begin,end} with __init Will Deacon
2014-04-28 20:13 ` Paul E. McKenney
2014-04-29  8:38   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).