Subject: [mm/vmalloc] a1a514f208: WARNING:at_kernel/locking/lockdep.c:#__lock_acquire

From: kernel test robot <[email-masked]>
Date: Tue, 18 Aug 2020 08:30:58 +0800

Greeting,

FYI, we noticed the following commit (built with gcc-9):

commit: a1a514f208c92f9812433b1d3943fd421ea36a74 ("[PATCH v4 8/8] mm/vmalloc: Hugepage vmalloc mappings")
url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/huge-vmalloc-mappings/20200816-171128
base: https://github.com/hnaz/linux-mm master

in testcase: boot

on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 8G

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):

+----------------------------------------------------------------------------+------------+------------+
|                                                                            | f7bfece000 | a1a514f208 |
+----------------------------------------------------------------------------+------------+------------+
| boot_successes                                                             | 16         | 3          |
| boot_failures                                                              | 2          | 50         |
| BUG:kernel_hang_in_test_stage                                              | 2          | 1          |
| BUG:sleeping_function_called_from_invalid_context_at_arch/x86/mm/fault.c   | 0          | 2          |
| RIP:__d_lookup_rcu                                                         | 0          | 7          |
| BUG:unable_to_handle_page_fault_for_address                                | 0          | 16         |
| Oops:#[##]                                                                 | 0          | 43         |
| Kernel_panic-not_syncing:Fatal_exception                                   | 0          | 16         |
| WARNING:at_kernel/locking/lockdep.c:#__lock_acquire                        | 0          | 27         |
| RIP:__lock_acquire                                                         | 0          | 28         |
| BUG:kernel_NULL_pointer_dereference,address                                | 0          | 27         |
| Kernel_panic-not_syncing:Fatal_exception_in_interrupt                      | 0          | 28         |
| RIP:kernfs_active                                                          | 0          | 1          |
| Kernel_panic-not_syncing:VFS:Unable_to_mount_root_fs_on_unknown-block(#,#) | 0          | 2          |
| RIP:__d_lookup                                                             | 0          | 2          |
| RIP:__handle_mm_fault                                                      | 0          | 1          |
| kernel_BUG_at_kernel/cgroup/cgroup.c                                       | 0          | 1          |
| invalid_opcode:#[##]                                                       | 0          | 1          |
| RIP:cset_cgroup_from_root                                                  | 0          | 1          |
| BUG:Bad_page_map_in_process                                                | 0          | 1          |
| BUG:Bad_rss-counter_state_mm:(____ptrval____)type:MM_FILEPAGES_val         | 0          | 1          |
| BUG:Bad_rss-counter_state_mm:(____ptrval____)type:MM_ANONPAGES_val         | 0          | 1          |
| BUG:Bad_rss-counter_state_mm:(____ptrval____)type:MM_SWAPENTS_val          | 0          | 1          |
| BUG:spinlock_bad_magic_on_CPU                                              | 0          | 2          |
| RIP:strcmp                                                                 | 0          | 1          |
| RIP:kmem_cache_alloc                                                       | 0          | 1          |
| BUG:kernel_reboot-without-warning_in_test_stage                            | 0          | 1          |
| RIP:rb_next                                                                | 0          | 1          |
+----------------------------------------------------------------------------+------------+------------+

If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email-masked]>

[   32.549285] WARNING: CPU: 0 PID: 588 at kernel/locking/lockdep.c:183 __lock_acquire+0x8b2/0xb20
[   32.552088] Modules linked in: ppdev joydev floppy parport_pc parport i2c_piix4
[   32.553704] CPU: 0 PID: 588 Comm: wget Not tainted 5.8.0-rc7-mm1-00429-ga1a514f208c92 #2
[   32.555876] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[   32.557749] RIP: 0010:__lock_acquire+0x8b2/0xb20
[   32.560218] Code: c0 0f 84 aa fe ff ff 44 8b 05 42 02 00 02 45 85 c0 0f 85 9a fe ff ff 48 c7 c6 89 9f a6 87 48 c7 c7 8d a3 9c 87 e8 ce 6e f8 ff <0f> 0b 31 c0 4c 8b 14 24 4c 8b 5c 24 08 e9 c6 f8 ff ff 4c 89 5c 24
[   32.570118] RSP: 0018:ffff9e5bc12e7bd8 EFLAGS: 00010086
[   32.571660] RAX: 0000000000000000 RBX: 37a6f4de9bd1360a RCX: 0000000000000000
[   32.573437] RDX: 0000000000000202 RSI: ffffffff879fb4bb RDI: 0000000000000001
[   32.575283] RBP: ffff90e6dbf80d50 R08: 0000000000000001 R09: 0000000000000000
[   32.577089] R10: ffffffff8981b1a0 R11: 000000008981add3 R12: 0000000000000001
[   32.579111] R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
[   32.580868] FS:  00007f27f0a6e700(0000) GS:ffff90e777c00000(0000) knlGS:0000000000000000
[   32.583113] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   32.584591] CR2: 00007f27efb530b0 CR3: 000000019a7f8000 CR4: 00000000000406f0
[   32.586551] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   32.588345] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   32.590117] Call Trace:
[   32.590953]  lock_acquire+0xab/0x390
[   32.591994]  ? __inet_hash_connect+0x164/0x540
[   32.593267]  ? lockdep_hardirqs_on_prepare+0xec/0x180
[   32.594778]  ? inet_get_local_port_range+0xb0/0xd0
[   32.596061]  _raw_spin_lock_bh+0x34/0x40
[   32.597168]  ? __inet_hash_connect+0x164/0x540
[   32.598387]  __inet_hash_connect+0x164/0x540
[   32.599586]  ? inet_lhash2_lookup+0x160/0x160
[   32.600787]  tcp_v4_connect+0x26f/0x560
[   32.601896]  __inet_stream_connect+0xc5/0x360
[   32.603263]  ? mark_held_locks+0x2d/0x80
[   32.604436]  ? lockdep_hardirqs_on_prepare+0xec/0x180
[   32.605811]  ? __local_bh_enable_ip+0x77/0xe0
[   32.607030]  inet_stream_connect+0x37/0x50
[   32.608180]  __sys_connect+0x9c/0xd0
[   32.609237]  ? _raw_spin_unlock_irq+0x35/0x50
[   32.610569]  ? syscall_enter_from_user_mode+0x25/0x2b0
[   32.612009]  ? syscall_enter_from_user_mode+0x2a/0x2b0
[   32.613403]  ? lockdep_hardirqs_on_prepare+0xec/0x180
[   32.614893]  ? syscall_enter_from_user_mode+0x2a/0x2b0
[   32.616282]  ? trace_hardirqs_on+0x41/0xf0
[   32.617464]  __x64_sys_connect+0x16/0x20
[   32.618790]  do_syscall_64+0x33/0x40
[   32.619903]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   32.621319] RIP: 0033:0x7f27efb2e2e0
[   32.622403] Code: 00 31 d2 48 29 c2 64 89 11 48 83 c8 ff eb ea 90 90 90 90 90 90 90 90 90 90 90 83 3d fd 8e 2c 00 00 75 10 b8 2a 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe ce 00 00 48 89 04 24
[   32.627108] RSP: 002b:00007fff83403e08 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
[   32.629151] RAX: ffffffffffffffda RBX: 00007fff83403ea0 RCX: 00007f27efb2e2e0
[   32.630950] RDX: 0000000000000010 RSI: 00007fff83403ec0 RDI: 0000000000000004
[   32.632788] RBP: 0000000000000004 R08: 00007fff83403d70 R09: 0000000000000001
[   32.637173] R10: 00007fff83403ba0 R11: 0000000000000246 R12: 0000000000000050
[   32.638935] R13: 000000000065ade0 R14: 0000000001975b30 R15: 000000000000000a
[   32.640686] irq event stamp: 8200
[   32.641686] hardirqs last  enabled at (8199): [<ffffffff86f4efc0>] inet_get_local_port_range+0xb0/0xd0
[   32.644245] hardirqs last disabled at (8198): [<ffffffff86f4ef43>] inet_get_local_port_range+0x33/0xd0
[   32.646202] softirqs last  enabled at (8196): [<ffffffff86e7292a>] lock_sock_nested+0x3a/0x90
[   32.648515] softirqs last disabled at (8200): [<ffffffff86f4e174>] __inet_hash_connect+0x164/0x540
[   32.651988] ---[ end trace dd07c03f65a4d766 ]---

To reproduce:

        # build kernel
	cd linux
	cp config-5.8.0-rc7-mm1-00429-ga1a514f208c92 .config
	make HOSTCC=gcc-9 CC=gcc-9 ARCH=x86_64 olddefconfig prepare modules_prepare bzImage

        git clone https://github.com/intel/lkp-tests.git
        cd lkp-tests
        bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email

Thanks,
lkp