Re: [LKP] [locking/lockdep] 15693f040b: WARNING:at_kernel/locking/lockdep.c:#lockdep_free_key_range

From: Bart Van Assche
Date: Mon Dec 17 2018 - 12:27:44 EST


On Mon, 2018-12-17 at 16:41 +-0800, kernel test robot wrote:
+AD4 FYI, we noticed the following commit (built with gcc-4.9):
+AD4
+AD4 commit: 15693f040b149ffff598cc048c2697b258d3901c (+ACI-locking/lockdep: Free lock classes that are no longer in use+ACI)
+AD4 https://github.com/bvanassche/linux for-next
+AD4
+AD4 in testcase: locktorture
+AD4 with following parameters:
+AD4
+AD4 runtime: 300s
+AD4 test: cpuhotplug
+AD4
+AD4 test-description: This torture test consists of creating a number of kernel threads which acquire the lock and hold it for specific amount of time, thus simulating different critical region
+AD4 behaviors.
+AD4 test-url: https://www.kernel.org/doc/Documentation/locking/locktorture.txt
+AD4
+AD4
+AD4 on test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 512M
+AD4
+AD4 caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
+AD4
+AD4
+AD4 +--------------------------------------------------------------+-------------+-------------+-
+AD4 +AD4 +AHw b7001c6cce +AHw 15693f040b +AHw
+AD4
+AD4 +--------------------------------------------------------------+-------------+-------------+-
+AD4 +AD4 boot+AF8-successes +AHw 0 +AHw 0 +AHw
+AD4 +AD4 boot+AF8-failures +AHw 394 +AHw 396 +AHw
+AD4 +AD4 WARNING:at+AF8-lib/debugobjects.c:+ACMAXwBf-debug+AF8-object+AF8-init +AHw 394 +AHw 396 +AHw
+AD4 +AD4 EIP:+AF8AXw-debug+AF8-object+AF8-init +AHw 394 +AHw 396 +AHw
+AD4 +AD4 WARNING:possible+AF8-circular+AF8-locking+AF8-dependency+AF8-detected +AHw 370 +AHw 375 +AHw
+AD4 +AD4 WARNING:at+AF8-kernel/locking/lockdep.c:+ACM-lock+AF8-downgrade +AHw 145 +AHw 159 +AHw
+AD4 +AD4 EIP:lock+AF8-downgrade +AHw 145 +AHw 159 +AHw
+AD4 +AD4 BUG:soft+AF8-lockup-CPU+ACMAIw-stuck+AF8-for+ACM-s +AHw 24 +AHw 21 +AHw
+AD4 +AD4 EIP:thread+AF8-lookup+AF8-test +AHw 12 +AHw 9 +AHw
+AD4 +AD4 Kernel+AF8-panic-not+AF8-syncing:softlockup:hung+AF8-tasks +AHw 24 +AHw 21 +AHw
+AD4 +AD4 EIP:memcmp +AHw 3 +AHw 3 +AHw
+AD4 +AD4 EIP:threadfunc +AHw 4 +AHw 2 +AHw
+AD4 +AD4 EIP:lock+AF8-acquire +AHw 3 +AHw 1 +AHw
+AD4 +AD4 EIP:lock+AF8-is+AF8-held+AF8-type +AHw 2 +AHw 2 +AHw
+AD4 +AD4 WARNING:at+AF8-net/sched/sch+AF8-generic.c:+ACM-dev+AF8-watchdog +AHw 1 +AHw +AHw
+AD4 +AD4 EIP:dev+AF8-watchdog +AHw 1 +AHw +AHw
+AD4 +AD4 WARNING:at+AF8-kernel/locking/lockdep.c:+ACM-lockdep+AF8-free+AF8-key+AF8-range +AHw 0 +AHw 22 +AHw
+AD4 +AD4 EIP:lockdep+AF8-free+AF8-key+AF8-range +AHw 0 +AHw 22 +AHw
+AD4 +AD4 EIP:lock+AF8-release +AHw 0 +AHw 2 +AHw
+AD4 +AD4 EIP:rht+AF8-deferred+AF8-worker +AHw 0 +AHw 2 +AHw
+AD4
+AD4 +--------------------------------------------------------------+-------------+-------------+-

The WARNING:at+AF8-kernel/locking/lockdep.c:+ACM-lockdep+AF8-free+AF8-key+AF8-range warnings were caused by the
following code:

pf +AD0 get+AF8-pending+AF8-free+AF8-lock(+ACY-flags)+ADs
if (WARN+AF8-ON+AF8-ONCE(+ACE-pf))
return+ADs

Before this report was produced I had already pushed out a new version of my lockdep patch
series to the for-next branch of my github repository in which that code had been modified
into the following:

pf +AD0 get+AF8-pending+AF8-free+AF8-lock(+ACY-flags)+ADs
if (+ACE-pf)
return+ADs

Since the above report refers to a WARN+AF8-ON+AF8-ONCE() statement that has been removed, I think
that this report can be ignored.

Bart.