From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Nadav Amit <namit@vmware.com>,
Ricardo Neri <ricardo.neri-calderon@linux.intel.com>,
Stephane Eranian <eranian@google.com>,
Feng Tang <feng.tang@intel.com>
Subject: [patch 17/18] x86/apic/flat64: Add conditional IPI shorthands support
Date: Wed, 03 Jul 2019 12:54:48 +0200 [thread overview]
Message-ID: <20190703105917.153388644@linutronix.de> (raw)
In-Reply-To: 20190703105431.096822793@linutronix.de
Use the shorthand broadcast delivery if the static key controlling it is
enabled. If not use the regular one by one IPI mechanism.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/apic/apic_flat_64.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -80,7 +80,9 @@ static void flat_send_IPI_allbutself(int
{
int cpu = smp_processor_id();
- if (IS_ENABLED(CONFIG_HOTPLUG_CPU) || vector == NMI_VECTOR) {
+ if (static_branch_likely(&apic_use_ipi_shorthand)) {
+ __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
+ } else {
if (!cpumask_equal(cpu_online_mask, cpumask_of(cpu))) {
unsigned long mask = cpumask_bits(cpu_online_mask)[0];
@@ -89,18 +91,15 @@ static void flat_send_IPI_allbutself(int
_flat_send_IPI_mask(mask, vector);
}
- } else if (num_online_cpus() > 1) {
- __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
}
}
static void flat_send_IPI_all(int vector)
{
- if (vector == NMI_VECTOR) {
- flat_send_IPI_mask(cpu_online_mask, vector);
- } else {
+ if (static_branch_likely(&apic_use_ipi_shorthand))
__default_send_IPI_shortcut(APIC_DEST_ALLINC, vector);
- }
+ else
+ flat_send_IPI_mask(cpu_online_mask, vector);
}
static unsigned int flat_get_apic_id(unsigned long x)
@@ -218,12 +217,19 @@ static void physflat_init_apic_ldr(void)
static void physflat_send_IPI_allbutself(int vector)
{
- default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
+ if (static_branch_likely(&apic_use_ipi_shorthand)) {
+ __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
+ } else {
+ default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
+ }
}
static void physflat_send_IPI_all(int vector)
{
- default_send_IPI_mask_sequence_phys(cpu_online_mask, vector);
+ if (static_branch_likely(&apic_use_ipi_shorthand))
+ __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
+ else
+ default_send_IPI_mask_sequence_phys(cpu_online_mask, vector);
}
static int physflat_probe(void)
next prev parent reply other threads:[~2019-07-03 11:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 10:54 [patch 00/18] x86/apic: Support for IPI shorthands Thomas Gleixner
2019-07-03 10:54 ` [patch 01/18] x86/apic: Invoke perf_events_lapic_init() after enabling APIC Thomas Gleixner
2019-07-03 10:54 ` [patch 02/18] x86/apic: Soft disable APIC before initializing it Thomas Gleixner
2019-07-03 10:54 ` [patch 03/18] x86/apic: Make apic_pending_intr_clear() more robust Thomas Gleixner
2019-07-03 10:54 ` [patch 04/18] x86/apic: Move IPI inlines into ipi.c Thomas Gleixner
2019-07-03 10:54 ` [patch 05/18] x86/apic: Cleanup the include maze Thomas Gleixner
2019-07-03 10:54 ` [patch 06/18] x86/apic: Move ipi header into apic directory Thomas Gleixner
2019-07-03 10:54 ` [patch 07/18] x86/apic: Move apic_flat_64 " Thomas Gleixner
2019-07-03 10:54 ` [patch 08/18] x86/apic: Consolidate the apic local headers Thomas Gleixner
2019-07-03 10:54 ` [patch 09/18] smp/hotplug: Track booted once CPUs in a cpumask Thomas Gleixner
2019-07-03 10:54 ` [patch 10/18] x86/cpu: Move arch_smt_update() to a neutral place Thomas Gleixner
2019-07-03 10:54 ` [patch 11/18] x86/hotplug: Silence APIC and NMI when CPU is dead Thomas Gleixner
2019-07-03 10:54 ` [patch 12/18] x86/apic: Remove dest argument from __default_send_IPI_shortcut() Thomas Gleixner
2019-07-03 10:54 ` [patch 13/18] x86/apic: Add NMI_VECTOR wait to IPI shorthand Thomas Gleixner
2019-07-03 10:54 ` [patch 14/18] x86/apic: Move no_ipi_broadcast() out of 32bit Thomas Gleixner
2019-07-03 10:54 ` [patch 15/18] x86/apic: Add static key to Control IPI shorthands Thomas Gleixner
2019-07-03 10:54 ` [patch 16/18] x86/apic: Convert 32bit to IPI shorthand static key Thomas Gleixner
2019-07-03 18:06 ` Nadav Amit
2019-07-03 20:34 ` Thomas Gleixner
2019-07-03 21:14 ` Nadav Amit
2019-07-03 21:30 ` Thomas Gleixner
2019-07-03 10:54 ` Thomas Gleixner [this message]
2019-07-03 10:54 ` [patch 18/18] x86/apic/x2apic: Add conditional IPI shorthands support Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190703105917.153388644@linutronix.de \
--to=tglx@linutronix.de \
--cc=eranian@google.com \
--cc=feng.tang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namit@vmware.com \
--cc=ricardo.neri-calderon@linux.intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox