Skip to content

Commit 92ee46e

Browse files
almostivanIngo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Jason Baron <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent b29c6ef commit 92ee46e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/jump_label.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ static __init int jump_label_test(void)
769769

770770
return 0;
771771
}
772-
late_initcall(jump_label_test);
772+
early_initcall(jump_label_test);
773773
#endif /* STATIC_KEYS_SELFTEST */
774774

775775
#endif /* HAVE_JUMP_LABEL */

0 commit comments

Comments
 (0)