• Oleg Nesterov's avatar
    rcu: Eliminate lockless accesses to rcu_sync->gp_count · 6f4cec22
    Oleg Nesterov authored
    The rcu_sync structure's ->gp_count field is always accessed under the
    protection of that same structure's ->rss_lock field, with the exception
    of a pair of WARN_ON_ONCE() calls just prior to acquiring that lock in
    functions rcu_sync_exit() and rcu_sync_dtor().  These lockless accesses
    are unnecessary and impair KCSAN's ability to catch bugs that might be
    inserted via other lockless accesses.
    
    This commit therefore moves those WARN_ON_ONCE() calls under the lock.
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    6f4cec22
sync.c 5.78 KB