• Paul E. McKenney's avatar
    rcu: Make rcu_cpu_starting() use its "cpu" argument · fdbb9b31
    Paul E. McKenney authored
    The rcu_cpu_starting() function uses this_cpu_ptr() to locate the
    incoming CPU's rcu_data structure.  This works for the boot CPU and for
    all CPUs onlined after rcu_init() executes (during very early boot).
    Currently, this is the full set of CPUs, so all is well.  But if
    anyone ever parallelizes boot before rcu_init() time, it will fail.
    This commit therefore substitutes the rcu_cpu_starting() function's
    this_cpu_pointer() for per_cpu_ptr(), future-proofing the code and
    (arguably) improving readability.
    
    This commit inadvertently fixes a latent bug: If there ever had been
    more than just the boot CPU online at rcu_init() time, the old code
    would not initialize the non-boot CPUs, but rather would repeatedly
    initialize the boot CPU.
    Reported-by: default avatarBoqun Feng <boqun.feng@gmail.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
    fdbb9b31
tree.c 131 KB