diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2019-10-27 18:19:38 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-11-12 13:44:20 +0300 |
commit | b264f57fde0c686c5c1dfdd0c21992c49196bb87 (patch) | |
tree | 2e77028b7799efca17bca51e4fe494f3aec6087f /arch/x86/include/asm/trace | |
parent | 83527ef7abf7c02c33a90b00f0954db35415adbd (diff) | |
download | linux-b264f57fde0c686c5c1dfdd0c21992c49196bb87.tar.xz |
x86/hyperv: Micro-optimize send_ipi_one()
When sending an IPI to a single CPU there is no need to deal with cpumasks.
With 2 CPU guest on WS2019 a minor (like 3%, 8043 -> 7761 CPU cycles)
improvement with smp_call_function_single() loop benchmark can be seeb. The
optimization, however, is tiny and straitforward. Also, send_ipi_one() is
important for PV spinlock kick.
Switching to the regular APIC IPI send for CPU > 64 case does not make
sense as it is twice as expesive (12650 CPU cycles for __send_ipi_mask_ex()
call, 26000 for orig_apic.send_IPI(cpu, vector)).
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Link: https://lkml.kernel.org/r/20191027151938.7296-1-vkuznets@redhat.com
Diffstat (limited to 'arch/x86/include/asm/trace')
-rw-r--r-- | arch/x86/include/asm/trace/hyperv.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/include/asm/trace/hyperv.h b/arch/x86/include/asm/trace/hyperv.h index ace464f09681..4d705cb4d63b 100644 --- a/arch/x86/include/asm/trace/hyperv.h +++ b/arch/x86/include/asm/trace/hyperv.h @@ -71,6 +71,21 @@ TRACE_EVENT(hyperv_send_ipi_mask, __entry->ncpus, __entry->vector) ); +TRACE_EVENT(hyperv_send_ipi_one, + TP_PROTO(int cpu, + int vector), + TP_ARGS(cpu, vector), + TP_STRUCT__entry( + __field(int, cpu) + __field(int, vector) + ), + TP_fast_assign(__entry->cpu = cpu; + __entry->vector = vector; + ), + TP_printk("cpu %d vector %x", + __entry->cpu, __entry->vector) + ); + #endif /* CONFIG_HYPERV */ #undef TRACE_INCLUDE_PATH |