Peter Zijlstra
9ed7d75b2f
x86/percpu: Relax smp_processor_id()
Nadav reported that since this_cpu_read() became asm-volatile, many
smp_processor_id() users generated worse code due to the extra
constraints.
However since smp_processor_id() is reading a stable value, we can use
__this_cpu_read().
While this does reduce text size somewhat, this mostly results in code
movement to .text.unlikely as a result of more/larger .cold.
subfunctions. Less text on the hotpath is good for I$.
$ ./compare.sh defconfig-build1 defconfig-build2 vmlinux.o
setup_APIC_ibs 90 98 -12,+20
force_ibs_eilvt_setup 400 413 -57,+70
pci_serr_error 109 104 -54,+49
pci_serr_error 109 104 -54,+49
unknown_nmi_error 125 120 -76,+71
unknown_nmi_error 125 120 -76,+71
io_check_error 125 132 -97,+104
intel_thermal_interrupt 730 822 +92,+0
intel_init_thermal 951 945 -6,+0
generic_get_mtrr 301 294 -7,+0
generic_get_mtrr 301 294 -7,+0
generic_set_all 749 754 -44,+49
get_fixed_ranges 352 360 -41,+49
x86_acpi_suspend_lowlevel 369 363 -6,+0
check_tsc_sync_source 412 412 -71,+71
irq_migrate_all_off_this_cpu 662 674 -14,+26
clocksource_watchdog 748 748 -113,+113
__perf_event_account_interrupt 204 197 -7,+0
attempt_merge 1748 1741 -7,+0
intel_guc_send_ct 1424 1409 -15,+0
__fini_doorbell 235 231 -4,+0
bdw_set_cdclk 928 923 -5,+0
gen11_dsi_disable 1571 1556 -15,+0
gmbus_wait 493 488 -5,+0
md_make_request 376 369 -7,+0
__split_and_process_bio 543 536 -7,+0
delay_tsc 96 89 -7,+0
hsw_disable_pc8 696 691 -5,+0
tsc_verify_tsc_adjust 215 228 -22,+35
cpuidle_driver_unref 56 49 -7,+0
blk_account_io_completion 159 148 -11,+0
mtrr_wrmsr 95 99 -29,+33
__intel_wait_for_register_fw 401 419 +18,+0
cpuidle_driver_ref 43 36 -7,+0
cpuidle_get_driver 15 8 -7,+0
blk_account_io_done 535 528 -7,+0
irq_migrate_all_off_this_cpu 662 674 -14,+26
check_tsc_sync_source 412 412 -71,+71
irq_wait_for_poll 170 163 -7,+0
generic_end_io_acct 329 322 -7,+0
x86_acpi_suspend_lowlevel 369 363 -6,+0
nohz_balance_enter_idle 198 191 -7,+0
generic_start_io_acct 254 247 -7,+0
blk_account_io_start 341 334 -7,+0
perf_event_task_tick 682 675 -7,+0
intel_init_thermal 951 945 -6,+0
amd_e400_c1e_apic_setup 47 51 -28,+32
setup_APIC_eilvt 350 328 -22,+0
hsw_enable_pc8 1611 1605 -6,+0
total 12985947 12985892 -994,+939
Reported-by: Nadav Amit <nadav.amit@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-06-17 12:43:41 +02:00
..
2019-05-30 11:26:37 -07:00
2019-06-05 17:37:04 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2019-05-31 14:27:27 -07:00
2019-06-05 17:37:18 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:07 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:37:12 +02:00
2019-05-24 17:36:45 +02:00
2019-05-15 18:21:43 -07:00
2019-06-05 17:37:18 +02:00
2019-05-20 08:21:07 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:29:19 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:29:22 -07:00
2019-06-05 17:37:18 +02:00
2019-05-30 11:29:22 -07:00
2019-06-05 17:37:17 +02:00
2019-05-24 17:27:13 +02:00
2019-06-05 17:37:15 +02:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:40 +02:00
2019-06-17 12:28:00 +02:00
2019-05-30 11:29:53 -07:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:09 +02:00
2019-06-05 17:37:09 +02:00
2019-05-30 11:26:37 -07:00
2019-06-05 17:37:16 +02:00
2019-06-05 17:30:29 +02:00
2019-06-05 17:37:05 +02:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:27:12 +02:00
2019-06-05 17:37:06 +02:00
2019-05-24 17:39:02 +02:00
2019-05-30 11:29:55 -07:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:36:37 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:37:17 +02:00
2019-05-21 11:28:46 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:37:52 +02:00
2019-05-24 17:37:52 +02:00
2019-06-05 17:37:07 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-23 10:25:26 -06:00
2019-05-30 11:26:41 -07:00
2019-05-23 10:25:26 -06:00
2019-05-23 10:25:26 -06:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:29:53 -07:00
2019-05-30 11:29:53 -07:00
2019-06-14 17:46:14 -10:00
2019-05-31 10:38:58 -07:00
2019-05-15 13:21:37 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:25:18 -07:00
2019-05-30 11:26:35 -07:00
2019-05-18 15:52:26 -07:00
2019-05-24 17:27:11 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:39 -07:00
2019-06-05 17:36:37 +02:00
2019-06-03 12:02:03 +02:00
2019-06-15 10:00:29 +02:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:53 -07:00
2019-05-20 15:02:08 -07:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:37 -07:00
2019-06-05 17:37:05 +02:00
2019-06-13 17:34:56 -10:00
2019-05-24 17:37:52 +02:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:29:21 -07:00
2019-05-30 11:29:21 -07:00
2019-05-24 17:37:54 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:41 -07:00
2019-05-21 11:28:40 +02:00
2019-06-05 17:37:05 +02:00
2019-05-15 17:35:54 +01:00
2019-05-24 17:37:53 +02:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:26:32 -07:00
2019-05-25 16:33:36 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:27:12 +02:00
2019-05-15 16:05:47 -07:00
2019-06-13 17:34:56 -10:00
2019-06-01 15:51:32 -07:00
2019-05-30 11:29:53 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:36:38 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:37 -07:00
2019-05-21 11:28:39 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:05 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-21 11:28:39 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:55 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:05 +02:00
2019-05-30 11:26:41 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:16 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:36:45 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2019-05-24 17:37:52 +02:00
2019-05-30 11:26:35 -07:00
2019-06-17 12:09:22 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:16 +02:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:27:11 +02:00
2019-05-24 17:36:45 +02:00
2019-06-05 17:37:06 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:37:16 +02:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:29:19 -07:00
2019-05-15 23:39:38 +02:00
2019-05-30 11:29:22 -07:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:07 +02:00
2019-05-21 11:28:46 +02:00
2019-05-24 17:39:02 +02:00
2019-06-05 17:36:38 +02:00
2019-06-01 15:51:31 -07:00
2019-05-16 15:55:48 -07:00
2019-05-21 11:28:45 +02:00
2019-06-05 17:37:06 +02:00
2019-06-17 12:09:24 +02:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:37:53 +02:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:32 -07:00
2019-06-13 17:34:56 -10:00
2019-06-13 17:34:56 -10:00
2019-06-05 17:36:38 +02:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:45 +02:00
2019-05-30 11:26:41 -07:00
2019-06-07 13:09:06 -07:00
2019-05-24 17:27:10 +02:00
2019-05-19 10:58:45 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:36:38 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:41 -07:00
2019-06-05 17:37:16 +02:00
2019-06-05 17:37:16 +02:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:30:29 +02:00
2019-05-16 10:29:00 -07:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:39 -07:00
2019-05-30 11:29:19 -07:00
2019-05-27 10:55:08 +02:00
2019-06-05 17:37:07 +02:00
2019-05-21 10:50:45 +02:00
2019-06-17 12:28:06 +02:00
2019-05-17 10:33:30 -07:00
2019-06-05 17:37:07 +02:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:52 -07:00
2019-06-05 17:37:16 +02:00
2019-05-21 11:28:45 +02:00
2019-06-05 17:37:07 +02:00
2019-06-05 17:37:16 +02:00
2019-06-05 17:37:16 +02:00
2019-06-05 17:37:16 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:29:54 -07:00
2019-06-05 17:37:04 +02:00
2019-05-30 11:26:32 -07:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:41 -07:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:06 +02:00
2019-05-24 17:36:45 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2019-05-17 10:08:59 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-06-03 13:26:20 -07:00
2019-05-30 11:29:21 -07:00
2019-06-05 17:36:37 +02:00
2019-05-16 09:45:20 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2019-05-21 11:28:46 +02:00
2019-05-21 11:28:46 +02:00
2019-06-17 12:28:06 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:29:52 -07:00
2019-05-24 17:39:00 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:41 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-16 15:51:55 -07:00
2019-05-30 11:29:19 -07:00
2019-06-17 12:43:41 +02:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:37 -07:00
2019-06-05 17:37:05 +02:00
2019-06-05 17:37:16 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:04 +02:00
2019-06-03 10:44:21 +02:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:29:22 -07:00
2019-06-05 17:37:09 +02:00
2019-06-05 17:37:16 +02:00
2019-05-21 11:28:46 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:32 -07:00
2019-05-16 16:16:18 -07:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:29:19 -07:00
2019-05-30 11:26:37 -07:00
2019-05-24 17:39:02 +02:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:29:21 -07:00
2019-06-05 17:37:09 +02:00
2019-06-05 17:37:17 +02:00
2019-06-03 12:32:57 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:04 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:41 -07:00
2019-06-05 17:30:29 +02:00
2019-05-24 17:27:11 +02:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:27:13 +02:00
2019-05-24 17:27:13 +02:00
2019-06-05 17:30:27 +02:00
2019-05-24 17:39:00 +02:00
2019-06-05 17:37:05 +02:00
2019-05-18 15:52:26 -07:00
2019-06-05 17:37:05 +02:00
2019-06-05 17:37:05 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:37 -07:00
2019-05-15 17:35:54 +01:00
2019-06-05 17:37:07 +02:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:36:47 +02:00