Re: 669de8bda8 ("kernel/workqueue: Use dynamic lockdep keys for .."): WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:995 lockdep_register_key

From: Bart Van Assche
Date: Fri Mar 08 2019 - 11:36:51 EST


On Fri, 2019-03-08 at 12:48 +-0800, kernel test robot wrote:
+AD4 +AFs 1.855169+AF0 spin+AF8-lock-torture: lock+AF8-torture+AF8-stats task started
+AD4 +AFs 2.565387+AF0 workingset: timestamp+AF8-bits+AD0-14 max+AF8-order+AD0-17 bucket+AF8-order+AD0-3
+AD4 +AFs 2.567522+AF0 NFS: Registering the id+AF8-resolver key type
+AD4 +AFs 2.568478+AF0 Key type id+AF8-resolver registered
+AD4 +AFs 2.569072+AF0 Key type id+AF8-legacy registered
+AD4 +AFs 2.570808+AF0 WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:995 lockdep+AF8-register+AF8-key+-0x37/0x386
+AD4 +AFs 2.571658+AF0 CPU: 0 PID: 1 Comm: swapper Not tainted 5.0.0-rc8-00054-g669de8b +ACM-496
+AD4 +AFs 2.571658+AF0 Hardware name: QEMU Standard PC (i440FX +- PIIX, 1996), BIOS 1.10.2-1 04/01/2014
+AD4 +AFs 2.571658+AF0 EIP: lockdep+AF8-register+AF8-key+-0x37/0x386
+AD4 +AFs 2.571658+AF0 Code: 20 45 65 94 01 83 15 24 45 65 94 00 81 fe 00 00 80 92 72 2e 81 fe 00 d0 88 95 73 26 83 05 40 45 65 94 01 83 15 44 45 65 94 00 +ADw-0f+AD4 0b 83 05 48 45 65 94 01 83 15 4c 45 65 94 00
+AD4 83 c4 1c 5b 5e 5f
+AD4 +AFs 2.571658+AF0 EAX: 9586d254 EBX: 9586d1c0 ECX: 944f9cd8 EDX: 00000000
+AD4 +AFs 2.571658+AF0 ESI: 9586d254 EDI: 9586d274 EBP: 975a9ee4 ESP: 975a9ebc
+AD4 +AFs 2.571658+AF0 DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00210246
+AD4 +AFs 2.571658+AF0 CR0: 80050033 CR2: 00000000 CR3: 1c4a5000 CR4: 00340690
+AD4 +AFs 2.571658+AF0 DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
+AD4 +AFs 2.571658+AF0 DR6: fffe0ff0 DR7: 00000400
+AD4 +AFs 2.571658+AF0 Call Trace:
+AD4 +AFs 2.571658+AF0 ? debug+AF8-mutex+AF8-init+-0x4b/0x63
+AD4 +AFs 2.571658+AF0 ? +AF8AXw-mutex+AF8-init+-0x59/0x6c
+AD4 +AFs 2.571658+AF0 alloc+AF8-workqueue+-0x227/0x84e
+AD4 +AFs 2.571658+AF0 ? proc+AF8-create+-0x3e/0x52
+AD4 +AFs 2.571658+AF0 ? trace+AF8-event+AF8-define+AF8-fields+AF8-smb3+AF8-rw+AF8-err+AF8-class+-0x1b9/0x1b9
+AD4 +AFs 2.571658+AF0 init+AF8-cifs+-0x159/0x72f
+AD4 +AFs 2.571658+AF0 do+AF8-one+AF8-initcall+-0x2c4/0x6bf
+AD4 +AFs 2.571658+AF0 kernel+AF8-init+AF8-freeable+-0x6ef/0x841
+AD4 +AFs 2.571658+AF0 ? rest+AF8-init+-0x473/0x473
+AD4 +AFs 2.571658+AF0 kernel+AF8-init+-0x1e/0x26b
+AD4 +AFs 2.571658+AF0 ? schedule+AF8-tail+AF8-wrapper+-0x9/0xc
+AD4 +AFs 2.571658+AF0 ret+AF8-from+AF8-fork+-0x1e/0x28
+AD4 +AFs 2.571658+AF0 irq event stamp: 410062
+AD4 +AFs 2.571658+AF0 hardirqs last enabled at (410061): +AFsAPA-93a2ac73+AD4AXQ +AF8-raw+AF8-spin+AF8-unlock+AF8-irqrestore+-0x133/0x17e
+AD4 +AFs 2.571658+AF0 hardirqs last disabled at (410062): +AFsAPA-92801bca+AD4AXQ trace+AF8-hardirqs+AF8-off+AF8-thunk+-0xc/0x10
+AD4 +AFs 2.571658+AF0 softirqs last enabled at (409970): +AFsAPA-93a2da14+AD4AXQ +AF8AXw-do+AF8-softirq+-0x904/0xa1d
+AD4 +AFs 2.571658+AF0 softirqs last disabled at (409965): +AFsAPA-92813eb9+AD4AXQ do+AF8-softirq+AF8-own+AF8-stack+-0x3d/0x51
+AD4 +AFs 2.571658+AF0 ---+AFs end trace c4eabde80fbbdbf0 +AF0----
+AD4 +AFs 3.753943+AF0 String selftests succeeded

The following patch should fix this: +AFs-PATCH+AF0 kernel/wq: Fix a alloc+AF8-workqueue()
error path. See also
https://lore.kernel.org/lkml/20190303220046.29448-1-bvanassche+AEA-acm.org/

Bart.