lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6.0 664/862] rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE()
    Date
    From: Zqiang <qiang1.zhang@intel.com>

    [ Upstream commit fcd53c8a4dfa38bafb89efdd0b0f718f3a03f884 ]

    Kernels built with CONFIG_PROVE_RCU=y and CONFIG_DEBUG_LOCK_ALLOC=y
    attempt to emit a warning when the synchronize_rcu_tasks_generic()
    function is called during early boot while the rcu_scheduler_active
    variable is RCU_SCHEDULER_INACTIVE. However the warnings is not
    actually be printed because the debug_lockdep_rcu_enabled() returns
    false, exactly because the rcu_scheduler_active variable is still equal
    to RCU_SCHEDULER_INACTIVE.

    This commit therefore replaces RCU_LOCKDEP_WARN() with WARN_ONCE()
    to force these warnings to actually be printed.

    Signed-off-by: Zqiang <qiang1.zhang@intel.com>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    kernel/rcu/tasks.h | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
    index 83c7e6620d40..469bf2a3b505 100644
    --- a/kernel/rcu/tasks.h
    +++ b/kernel/rcu/tasks.h
    @@ -560,7 +560,7 @@ static int __noreturn rcu_tasks_kthread(void *arg)
    static void synchronize_rcu_tasks_generic(struct rcu_tasks *rtp)
    {
    /* Complain if the scheduler has not started. */
    - RCU_LOCKDEP_WARN(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
    + WARN_ONCE(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
    "synchronize_rcu_tasks called too soon");

    // If the grace-period kthread is running, use it.
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-10-19 11:26    [W:3.564 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site