[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <58cad449.RTO+aYLdogbZs5Le%fengguang.wu@intel.com>
Date: Fri, 17 Mar 2017 02:07:05 +0800
From: kernel test robot <fengguang.wu@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKP <lkp@...org>, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, wfg@...ux.intel.com
Subject: [locking/lockdep] 383776fa75: INFO: trying to register
non-static key.
Greetings,
0day kernel testing robot got the below dmesg and the first bad commit is
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
commit 383776fa7527745224446337f2dcfb0f0d1b8b56
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Mon Feb 27 15:37:36 2017 +0100
Commit: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu Mar 16 09:57:08 2017 +0100
locking/lockdep: Handle statically initialized PER_CPU locks properly
If a PER_CPU struct which contains a spin_lock is statically initialized
via:
DEFINE_PER_CPU(struct foo, bla) = {
.lock = __SPIN_LOCK_UNLOCKED(bla.lock)
};
then lockdep assigns a seperate key to each lock because the logic for
assigning a key to statically initialized locks is to use the address as
the key. With per CPU locks the address is obvioulsy different on each CPU.
That's wrong, because all locks should have the same key.
To solve this the following modifications are required:
1) Extend the is_kernel/module_percpu_addr() functions to hand back the
canonical address of the per CPU address, i.e. the per CPU address
minus the per CPU offset.
2) Check the lock address with these functions and if the per CPU check
matches use the returned canonical address as the lock key, so all per
CPU locks have the same key.
3) Move the static_obj(key) check into look_up_lock_class() so this check
can be avoided for statically initialized per CPU locks. That's
required because the canonical address fails the static_obj(key) check
for obvious reasons.
Reported-by: Mike Galbraith <efault@....de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
[ Merged Dan's fixups for !MODULES and !SMP into this patch. ]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Dan Murphy <dmurphy@...com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20170227143736.pectaimkjkan5kow@linutronix.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
6419c4af77 locking/lockdep: Add new check to lock_downgrade()
383776fa75 locking/lockdep: Handle statically initialized PER_CPU locks properly
bf7b3ac2e3 locking/ww_mutex: Improve test to cover acquire context changes
712bff6b7c Merge branch 'perf/core'
+------------------------------------------+------------+------------+------------+------------+
| | 6419c4af77 | 383776fa75 | bf7b3ac2e3 | 712bff6b7c |
+------------------------------------------+------------+------------+------------+------------+
| boot_successes | 35 | 4 | 4 | 0 |
| boot_failures | 0 | 11 | 13 | 15 |
| INFO:trying_to_register_non-static_key | 0 | 11 | 13 | 13 |
| BUG:unable_to_handle_kernel | 0 | 0 | 0 | 2 |
| Oops:#[##] | 0 | 0 | 0 | 2 |
| Kernel_panic-not_syncing:Fatal_exception | 0 | 0 | 0 | 2 |
+------------------------------------------+------------+------------+------------+------------+
[ 11.688036] OF: overlay: overlay #5 is not topmost
[ 11.700999] i2c i2c-0: Added multiplexed i2c bus 1
[ 11.703106] i2c i2c-0: Added multiplexed i2c bus 2
[ 11.706811] ### dt-test ### end of unittest - 149 passed, 0 failed
[ 11.709138] Unregister pv shared memory for cpu 0
[ 11.712266] INFO: trying to register non-static key.
[ 11.713174] the code is fine but needs lockdep annotation.
[ 11.714597] turning off the locking correctness validator.
[ 11.715490] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc2-00009-g383776f #1
[ 11.717052] Call Trace:
[ 11.717476] dump_stack+0xc9/0x13a
[ 11.718514] register_lock_class+0x53a/0x570
[ 11.719115] ? __list_add_valid+0xd0/0x110
[ 11.719888] __lock_acquire+0xcb/0x18d0
[ 11.720470] ? mark_held_locks+0x76/0x90
[ 11.721442] ? _raw_spin_unlock_irqrestore+0x5d/0x80
[ 11.722505] lock_acquire+0x19d/0x1f0
[ 11.723127] ? hrtimers_dead_cpu+0xa6/0x3f0
[ 11.723845] _raw_spin_lock_nested+0x31/0x40
[ 11.724822] ? hrtimers_dead_cpu+0xa6/0x3f0
[ 11.725482] hrtimers_dead_cpu+0xa6/0x3f0
[ 11.726186] ? hrtimers_prepare_cpu+0x60/0x60
[ 11.727166] cpuhp_invoke_callback+0x1ef/0xd40
[ 11.728092] cpuhp_down_callbacks+0x3b/0x90
[ 11.728888] _cpu_down+0xca/0x180
[ 11.729656] do_cpu_down+0x4d/0x70
[ 11.730534] cpu_down+0xb/0x10
[ 11.731071] _debug_hotplug_cpu+0x5e/0x1a0
[ 11.731720] ? topology_init+0x54/0x54
[ 11.732241] ? do_early_param+0xbd/0xbd
[ 11.732930] debug_hotplug_cpu+0xd/0x11
[ 11.733580] do_one_initcall+0x9e/0x1e0
[ 11.734454] ? do_early_param+0xbd/0xbd
[ 11.735082] kernel_init_freeable+0x12a/0x1f1
[ 11.735728] ? rest_init+0x160/0x160
[ 11.736498] kernel_init+0x9/0x160
[ 11.737109] ret_from_fork+0x31/0x40
[ 11.738523] CPU 0 is now offline
[ 11.739618] debug: unmapping init [mem 0xffffffff828d7000-0xffffffff82a2cfff]
[ 11.740602] Write protecting the kernel read-only data: 16384k
[ 11.742476] debug: unmapping init [mem 0xffff880001922000-0xffff8800019fffff]
[ 11.743822] debug: unmapping init [mem 0xffff880001fbe000-0xffff880001ffffff]
# HH:MM RESULT GOOD BAD GOOD_BUT_DIRTY DIRTY_NOT_BAD
git bisect start 87311b8f20a9f2d69ced0ddd75f864cbbb8f4782 4495c08e84729385774601b5146d51d9e5849f81 --
git bisect bad 6abd7c49de2ee3dd8bf274287fd0bd912a799e6b # 21:46 B 0 11 22 0 Merge 'tip/x86/urgent' into devel-catchup-201703162033
git bisect good 97e8513c0da5f0f8d0f4cc3a1ef5ef5081ab04a2 # 22:08 G 11 0 0 0 Merge 'jpirko-mlxsw/jiri_devel_ovs' into devel-catchup-201703162033
git bisect bad 716d2bc3b40efc64d35088aaad470433547db24b # 22:28 B 0 3 14 0 Merge 'tip/perf/core' into devel-catchup-201703162033
git bisect good fb0656606b47d8d2b8e85a10a27aafe87cd03cec # 22:51 G 10 0 0 0 Merge 'tip/locking/urgent' into devel-catchup-201703162033
git bisect bad 7f8b2daaa0b268c158acaf200afcd70782409bfb # 23:14 B 0 9 20 0 Merge 'tip/locking/core' into devel-catchup-201703162033
git bisect good e969970be033841d4c16b2e8ec8a3608347db861 # 23:37 G 11 0 0 0 locking/lockdep: Factor out the validate_held_lock() helper function
git bisect bad 383776fa7527745224446337f2dcfb0f0d1b8b56 # 00:08 B 0 1 12 0 locking/lockdep: Handle statically initialized PER_CPU locks properly
git bisect good 6419c4af777a773a45a1b1af735de0fcd9a7dcc7 # 00:31 G 11 0 0 0 locking/lockdep: Add new check to lock_downgrade()
# first bad commit: [383776fa7527745224446337f2dcfb0f0d1b8b56] locking/lockdep: Handle statically initialized PER_CPU locks properly
git bisect good 6419c4af777a773a45a1b1af735de0fcd9a7dcc7 # 00:34 G 31 0 0 0 locking/lockdep: Add new check to lock_downgrade()
# extra tests with CONFIG_DEBUG_INFO_REDUCED
git bisect bad 383776fa7527745224446337f2dcfb0f0d1b8b56 # 00:57 B 0 11 22 0 locking/lockdep: Handle statically initialized PER_CPU locks properly
# extra tests on HEAD of linux-devel/devel-catchup-201703162033
git bisect bad 87311b8f20a9f2d69ced0ddd75f864cbbb8f4782 # 00:57 B 0 17 41 10 0day head guard for 'devel-catchup-201703162033'
# extra tests on tree/branch tip/locking/core
git bisect bad bf7b3ac2e36ac054f93e5dd8d85dfd754b5e1c09 # 01:18 B 0 11 23 0 locking/ww_mutex: Improve test to cover acquire context changes
# extra tests with first bad commit reverted
git bisect good ab00762e2e2daa97c9007e91e747295bee4b5d1d # 01:52 G 11 0 0 0 Revert "locking/lockdep: Handle statically initialized PER_CPU locks properly"
# extra tests on tree/branch tip/master
git bisect bad 712bff6b7cb93a02a483a5dcb68a99c58ef9bbdd # 02:06 B 0 11 26 4 Merge branch 'perf/core'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/lkp Intel Corporation
Download attachment "dmesg-quantal-lkp-hsw01-21:20170317000844:x86_64-randconfig-s2-03161921:4.11.0-rc2-00009-g383776f:1.gz" of type "application/gzip" (18898 bytes)
View attachment "reproduce-quantal-lkp-hsw01-21:20170317000844:x86_64-randconfig-s2-03161921:4.11.0-rc2-00009-g383776f:1" of type "text/plain" (888 bytes)
View attachment "config-4.11.0-rc2-00009-g383776f" of type "text/plain" (99582 bytes)
Powered by blists - more mailing lists