Matt Fleming
d7a702f0b1
perf/x86/intel/cqm: Do not access cpu_data() from CPU_UP_PREPARE handler
Tony reports that booting his 144-cpu machine with maxcpus=10 triggers
the following WARN_ON():
[ 21.045727] WARNING: CPU: 8 PID: 647 at arch/x86/kernel/cpu/perf_event_intel_cqm.c:1267 intel_cqm_cpu_prepare+0x75/0x90()
[ 21.045744] CPU: 8 PID: 647 Comm: systemd-udevd Not tainted 4.2.0-rc4 #1
[ 21.045745] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS BRHSXSD1.86B.0066.R00.1506021730 06/02/2015
[ 21.045747] 0000000000000000 0000000082771b09 ffff880856333ba8 ffffffff81669b67
[ 21.045748] 0000000000000000 0000000000000000 ffff880856333be8 ffffffff8107b02a
[ 21.045750] ffff88085b789800 ffff88085f68a020 ffffffff819e2470 000000000000000a
[ 21.045750] Call Trace:
[ 21.045757] [<ffffffff81669b67>] dump_stack+0x45/0x57
[ 21.045759] [<ffffffff8107b02a>] warn_slowpath_common+0x8a/0xc0
[ 21.045761] [<ffffffff8107b15a>] warn_slowpath_null+0x1a/0x20
[ 21.045762] [<ffffffff81036725>] intel_cqm_cpu_prepare+0x75/0x90
[ 21.045764] [<ffffffff81036872>] intel_cqm_cpu_notifier+0x42/0x160
[ 21.045767] [<ffffffff8109a33d>] notifier_call_chain+0x4d/0x80
[ 21.045769] [<ffffffff8109a44e>] __raw_notifier_call_chain+0xe/0x10
[ 21.045770] [<ffffffff8107b538>] _cpu_up+0xe8/0x190
[ 21.045771] [<ffffffff8107b65a>] cpu_up+0x7a/0xa0
[ 21.045774] [<ffffffff8165e920>] cpu_subsys_online+0x40/0x90
[ 21.045777] [<ffffffff81433b37>] device_online+0x67/0x90
[ 21.045778] [<ffffffff81433bea>] online_store+0x8a/0xa0
[ 21.045782] [<ffffffff81430e78>] dev_attr_store+0x18/0x30
[ 21.045785] [<ffffffff8126b6ba>] sysfs_kf_write+0x3a/0x50
[ 21.045786] [<ffffffff8126ad40>] kernfs_fop_write+0x120/0x170
[ 21.045789] [<ffffffff811f0b77>] __vfs_write+0x37/0x100
[ 21.045791] [<ffffffff811f38b8>] ? __sb_start_write+0x58/0x110
[ 21.045795] [<ffffffff81296d2d>] ? security_file_permission+0x3d/0xc0
[ 21.045796] [<ffffffff811f1279>] vfs_write+0xa9/0x190
[ 21.045797] [<ffffffff811f2075>] SyS_write+0x55/0xc0
[ 21.045800] [<ffffffff81067300>] ? do_page_fault+0x30/0x80
[ 21.045804] [<ffffffff816709ae>] entry_SYSCALL_64_fastpath+0x12/0x71
[ 21.045805] ---[ end trace fe228b836d8af405 ]---
The root cause is that CPU_UP_PREPARE is completely the wrong notifier
action from which to access cpu_data(), because smp_store_cpu_info()
won't have been executed by the target CPU at that point, which in turn
means that ->x86_cache_max_rmid and ->x86_cache_occ_scale haven't been
filled out.
Instead let's invoke our handler from CPU_STARTING and rename it
appropriately.
Reported-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Kanaka Juvva <kanaka.d.juvva@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vikas Shivappa <vikas.shivappa@intel.com>
Link: http://lkml.kernel.org/r/1438863163-14083-1-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-08-12 11:37:23 +02:00
..
2015-06-22 17:59:09 -07:00
2015-06-07 15:38:15 +02:00
2015-05-27 14:41:01 +02:00
2015-06-22 17:59:09 -07:00
2015-05-19 15:47:48 +02:00
2014-03-11 10:16:18 -07:00
2015-06-30 07:22:10 +02:00
2013-10-26 13:34:39 +02:00
2014-01-06 21:25:18 -08:00
2015-05-05 18:27:43 +01:00
2015-06-07 15:33:44 +02:00
2015-04-02 17:14:20 +02:00
2015-02-22 08:55:58 +01:00
2015-04-02 17:14:21 +02:00
2014-02-18 12:45:38 -08:00
2015-02-19 02:21:00 +01:00
2015-05-15 16:03:18 +02:00
2015-02-18 17:01:46 +01:00
2014-11-07 11:45:00 -08:00
2013-06-19 13:04:53 +02:00
2014-11-07 11:45:00 -08:00
2015-04-02 17:33:10 +02:00
2015-07-02 10:36:29 -07:00
2015-08-12 11:37:23 +02:00
2015-06-07 16:09:16 +02:00
2015-06-07 16:08:54 +02:00
2015-07-02 10:36:29 -07:00
2015-05-19 16:12:32 +02:00
2014-08-13 07:51:09 +02:00
2015-05-11 11:57:47 +02:00
2015-06-07 15:46:50 +02:00
2015-06-22 18:57:44 -07:00
2015-06-22 15:19:21 -07:00
2015-08-12 11:37:22 +02:00
2014-08-26 13:45:49 -04:00
2014-08-26 13:45:49 -04:00
2014-02-09 13:08:24 +01:00
2015-06-30 13:08:46 +02:00
2015-06-22 15:45:41 -07:00
2015-05-27 15:22:17 +02:00
2014-05-11 20:25:20 -07:00
2015-04-02 17:14:18 +02:00
2013-07-14 19:36:56 -04:00
2014-01-06 21:25:18 -08:00
2014-01-06 21:25:18 -08:00
2013-08-05 06:35:33 -07:00