All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Jason Baron <jbaron@akamai.com>
Cc: rostedt@goodmis.org, peterz@infradead.org,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] jump_label: invoke jump_label_test() via early_initcall()
Date: Mon, 13 Nov 2017 14:15:26 -0800	[thread overview]
Message-ID: <20171113221526.GL3624@linux.vnet.ibm.com> (raw)
In-Reply-To: <1510609727-2238-1-git-send-email-jbaron@akamai.com>

On Mon, Nov 13, 2017 at 04:48:47PM -0500, Jason Baron wrote:
> Fengguang Wu reported that running the rcuperf test during boot can cause
> the jump_label_test() to hit a WARN_ON(). The issue is that the core jump
> label code relies on kernel_text_address() to detect when it can no longer
> update branches that may be contained in __init sections. The
> kernel_text_address() in turn assumes that if the system_state variable is
> greter than or equal to SYSTEM_RUNNING then __init sections are no longer
> valid (since the assumption is that they have been freed). However, when
> rcuperf is setup to run in early boot it can call kernel_power_off() which
> sets the system_state to SYSTEM_POWER_OFF.
> 
> Since rcuperf initialization is invoked via a module_init(), we can make
> the dependency of jump_label_test() needing to complete before rcuperf
> explicit by calling it via early_initcall().
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Jason Baron <jbaron@akamai.com>

Looks way simpler than handling this three times in rcuperf, rcutorture,
and locktorture!

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

> ---
>  kernel/jump_label.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/jump_label.c b/kernel/jump_label.c
> index 0bf2e8f5..7c3774a 100644
> --- a/kernel/jump_label.c
> +++ b/kernel/jump_label.c
> @@ -769,7 +769,7 @@ static __init int jump_label_test(void)
> 
>  	return 0;
>  }
> -late_initcall(jump_label_test);
> +early_initcall(jump_label_test);
>  #endif /* STATIC_KEYS_SELFTEST */
> 
>  #endif /* HAVE_JUMP_LABEL */
> -- 
> 2.6.1
> 

  reply	other threads:[~2017-11-13 22:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 21:48 [PATCH] jump_label: invoke jump_label_test() via early_initcall() Jason Baron
2017-11-13 22:15 ` Paul E. McKenney [this message]
2017-11-14  9:32 ` [tip:locking/urgent] jump_label: Invoke " tip-bot for Jason Baron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171113221526.GL3624@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=jbaron@akamai.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.