Commit 0126574f authored by Bart Van Assche's avatar Bart Van Assche Committed by Ingo Molnar

locking/lockdep: Only call init_rcu_head() after RCU has been initialized

init_data_structures_once() is called for the first time before RCU has
been initialized. Make sure that init_rcu_head() is called before the
RCU head is used and after RCU has been initialized.
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: longman@redhat.com
Link: https://lkml.kernel.org/r/c20aa0f0-42ab-a884-d931-7d4ec2bf0cdc@acm.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 3fe7522f
...@@ -982,15 +982,22 @@ static inline void check_data_structures(void) { } ...@@ -982,15 +982,22 @@ static inline void check_data_structures(void) { }
*/ */
static void init_data_structures_once(void) static void init_data_structures_once(void)
{ {
static bool initialization_happened; static bool ds_initialized, rcu_head_initialized;
int i; int i;
if (likely(initialization_happened)) if (likely(rcu_head_initialized))
return; return;
initialization_happened = true; if (system_state >= SYSTEM_SCHEDULING) {
init_rcu_head(&delayed_free.rcu_head);
rcu_head_initialized = true;
}
if (ds_initialized)
return;
ds_initialized = true;
init_rcu_head(&delayed_free.rcu_head);
INIT_LIST_HEAD(&delayed_free.pf[0].zapped); INIT_LIST_HEAD(&delayed_free.pf[0].zapped);
INIT_LIST_HEAD(&delayed_free.pf[1].zapped); INIT_LIST_HEAD(&delayed_free.pf[1].zapped);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment