]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lockdep: Explicitly flag likely false-positive report
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 5 Apr 2021 16:47:59 +0000 (09:47 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 6 Apr 2021 23:10:34 +0000 (16:10 -0700)
The reason that lockdep_rcu_suspicious() prints the value of debug_locks
is because a value of zero indicates a likely false positive.  This can
work, but is a bit obtuse.  This commit therefore explicitly calls out
the possibility of a false positive.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/locking/lockdep.c

index c6d0c1dc625324cd8bbbaaf78f1c2709f30dd345..80065cdfd6f90d10d27d209c399958bea1d434c7 100644 (file)
@@ -6387,6 +6387,7 @@ asmlinkage __visible void lockdep_sys_exit(void)
 void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
 {
        struct task_struct *curr = current;
+       int dl = READ_ONCE(debug_locks);
 
        /* Note: the following can be executed concurrently, so be careful. */
        pr_warn("\n");
@@ -6396,11 +6397,12 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
        pr_warn("-----------------------------\n");
        pr_warn("%s:%d %s!\n", file, line, s);
        pr_warn("\nother info that might help us debug this:\n\n");
-       pr_warn("\n%srcu_scheduler_active = %d, debug_locks = %d\n",
+       pr_warn("\n%srcu_scheduler_active = %d, debug_locks = %d\n%s",
               !rcu_lockdep_current_cpu_online()
                        ? "RCU used illegally from offline CPU!\n"
                        : "",
-              rcu_scheduler_active, debug_locks);
+              rcu_scheduler_active, dl,
+              dl ? "" : "Possible false positive due to lockdep disabling via debug_locks = 0\n");
 
        /*
         * If a CPU is in the RCU-free window in idle (ie: in the section