From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754267AbdKNJgN (ORCPT ); Tue, 14 Nov 2017 04:36:13 -0500 Received: from terminus.zytor.com ([65.50.211.136]:35741 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754136AbdKNJfw (ORCPT ); Tue, 14 Nov 2017 04:35:52 -0500 Date: Tue, 14 Nov 2017 01:32:08 -0800 From: tip-bot for Jason Baron Message-ID: Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, rostedt@goodmis.org, paulmck@linux.vnet.ibm.com, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de, jbaron@akamai.com, fengguang.wu@intel.com Reply-To: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, paulmck@linux.vnet.ibm.com, rostedt@goodmis.org, torvalds@linux-foundation.org, hpa@zytor.com, tglx@linutronix.de, jbaron@akamai.com, fengguang.wu@intel.com In-Reply-To: <1510609727-2238-1-git-send-email-jbaron@akamai.com> References: <1510609727-2238-1-git-send-email-jbaron@akamai.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/urgent] jump_label: Invoke jump_label_test() via early_initcall() Git-Commit-ID: 92ee46efeb505ead3ab06d3c5ce695637ed5f152 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 92ee46efeb505ead3ab06d3c5ce695637ed5f152 Gitweb: https://git.kernel.org/tip/92ee46efeb505ead3ab06d3c5ce695637ed5f152 Author: Jason Baron AuthorDate: Mon, 13 Nov 2017 16:48:47 -0500 Committer: Ingo Molnar CommitDate: Tue, 14 Nov 2017 08:41:41 +0100 jump_label: Invoke jump_label_test() via early_initcall() 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 Signed-off-by: Jason Baron Acked-by: Paul E. McKenney Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1510609727-2238-1-git-send-email-jbaron@akamai.com Signed-off-by: Ingo Molnar --- 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 8ff4ca4..8594d24 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 */