Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1228906
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Daniel J Blueman <daniel@numascale.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/4] x86: Add Numachip IPI optimisations |
| Date | Sun, 20 Sep 2015 19:20:01 +0200 |
| Message-ID | <qaQrn-6fo-1@gated-at.bofh.it> (permalink) |
| References | <qaQrn-6fo-3@gated-at.bofh.it> |
| X-Original-To | Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com> |
| Authentication-Results | spf=none (sender IP is ) smtp.mailfrom=daniel@numascale.com; |
| X-Mailer | git-send-email 2.5.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| X-Originating-IP | [175.156.157.249] |
| X-Clientproxiedby | DB5PR03CA0064.eurprd03.prod.outlook.com (25.164.34.32) To AM4PR07MB1298.eurprd07.prod.outlook.com (25.164.81.156) |
| X-Microsoft-Exchange-Diagnostics | 1;AM4PR07MB1298;2:EQKLNuVDuwtnYCgAPQyQOUR5vJfb5ZUqWxu4kEE3/x0JnbH+gMzrIG+tDNi5SJqZKpZIJLNHUFoRQT2szIW5HQOA6rp9ufs9xe6W2bYnJST/YGAXbkfHkkr95zzNrIuc8n5hd1gpRWPW9piLStVmZQb0yHxLNgKof1T4KTk7iiA=;3:m9FBF4AN+L3FSFb/xMdVfVOxguZnkt0Q/SIM7RyrV6LOgmpg/wtZoKPRMmomfYi0pcoybguUVuzpuYK3KGYF1EdZunPOk9zPDnNM71Ahn/i33PMPCBoz73v9unU0UPkYYv2mJ++ic6EF0KMj5CZ/RA==;25:8GJ6scBG+BJ6hB13H52CJ6PWi7XiNcq2qMQfPT556TclLhsQ7wkh6WPhkTLAUn7XdA4a5X9iLXI1XgE2GruLcjejcZ8erSYUnJplLQCCZNOjiMKZFpUI88BH65eho/BoyzGTX7OGiG3CY+ny//P8EooWK7bMO/NZDwUHVj3XVQ+nlndjLX6UBxfNaNxnuuhzDV/bxQSfjK/VQ/4TF1o7fMXbjM9Ww9giGLdhemgR9oV+bHdbiQaoY9vnYjPfmkggg/4GtAzJidbyTjV0eAgi5g==;4:6oA5wzAlCOqW45xOf08RBIxPK8ID+w9y7kOW95MVo4FTP02mGVtYHjWK4uptzROTh5b1R666z5Po07yN71pAPd9SBnWsNmIgeY7uvtRaSE2+BfTtDyqxoikAPEExZBm3XTbhir8oFdyQKfmFukWEWFPHIQRr2VqtQcS4ocAV7x38jg1eA3CSZf9eyHFyk3/X+FggiGWW9kQmkwoHQ1jrnVouW3nEnDXBk4mGZuFn0EYX2LKhQtSKmlGciKyZdAsd |
| X-Microsoft-Antispam | UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM4PR07MB1298; |
| X-Exchange-Antispam-Report-Cfa | BCL:0;PCL:0;RULEID:;SRVR:AM4PR07MB1298;BCL:0;PCL:0;RULEID:;SRVR:AM4PR07MB1298; |
| X-Forefront-Prvs | 0705EB1700 |
| X-Forefront-Antispam-Report | SFV:NSPM;SFS:(10019020)(979002)(6009001)(6069001)(189002)(199003)(33646002)(122386002)(46102003)(101416001)(92566002)(19580395003)(76176999)(62966003)(19580405001)(5001770100001)(77156002)(50986999)(87976001)(86362001)(36756003)(4001540100001)(40100003)(5001830100001)(81156007)(97736004)(50226001)(5001860100001)(189998001)(2950100001)(42186005)(106356001)(47776003)(77096005)(68736005)(105586002)(5004730100002)(229853001)(5003940100001)(64706001)(50466002)(48376002)(66066001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR07MB1298;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; |
| Received-Spf | None (protection.outlook.com: numascale.com does not designate permitted sender hosts) |
| X-Microsoft-Exchange-Diagnostics | 1;AM4PR07MB1298;23:QHXYD3e8dKM4BwHukg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qNYuKtOAoLd4wfzR+fCMu8Idlm6JcnSSwR7HLv8tHpoagTSVCbpg/0Z67mS5frRSh9mJPBb4Yiwo/Itf/hc5hCBvsWeVlqhluZJlBqLH0rzQ0ub8pdwCuvEhzHAO |
| X-Microsoft-Exchange-Diagnostics | 1;AM4PR07MB1298;5:wiQ1x6dV9xKIXTymvPnveOZEwyou3/JHRwFp5+Ob0mWRk06PO5eeumMI7ksv0dQGnuR0kgRhjDK5dRF3JxikSEjvwRsVGLiwTMqEyyI7K8J+Kbsk+fihq2lhYDfzMQzvXLu6QiZCZRI+Ak6zKSSQzg==;24:O3P/83bye7E1uKFd6Qh/MpHAdP/V7nnkG93OlZTnpmne/KGNG6hfE614Fu86Z3/6VhisUnc3l5pP5Z5kUJU8AyxaHKoo+r8PULYRL7t6Pwc=;20:6aKED0LR+/oOcttmrJs2W1aee5PehGfIOCbjrNOryySxtckcgRxoc65olnamlMDJevTmgVJ3zoToOZyYfJKftg== |
| Spamdiagnosticoutput | 1:23 |
| Spamdiagnosticmetadata | NSPM |
| X-Originatororg | numascale.com |
| X-Ms-Exchange-Crosstenant-Originalarrivaltime | 20 Sep 2015 17:02:24.5588 (UTC) |
| X-Ms-Exchange-Crosstenant-Fromentityheader | Hosted |
| X-Ms-Exchange-Transport-Crosstenantheadersstamped | AM4PR07MB1298 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 105 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Daniel J Blueman <daniel@numascale.com>, <x86@kernel.org>, <linux-kernel@vger.kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Steffen Persvold <sp@numascale.com> |
| X-Original-Date | Mon, 21 Sep 2015 01:02:01 +0800 |
| X-Original-Message-ID | <1442768522-19217-3-git-send-email-daniel@numascale.com> |
| X-Original-References | <1442768522-19217-1-git-send-email-daniel@numascale.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1228906 |
Show key headers only | View raw
When sending IPIs, first check if the non-local part of the source and
destination APIC IDs match; if so, send via the local APIC for efficiency.
Secondly, since the AMD BIOS-kernel developer guide states IPI delivery
will occur invarient of prior deliver status, avoid polling the delivery
status bit for efficiency.
Signed-off-by: Daniel J Blueman <daniel@numascale.com>
Acked-by: Steffen Persvold <sp@numascale.com>
---
arch/x86/include/asm/numachip/numachip_csr.h | 1 +
arch/x86/kernel/apic/apic_numachip.c | 36 ++++++++++++++++++++++++----
2 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/numachip/numachip_csr.h b/arch/x86/include/asm/numachip/numachip_csr.h
index c7efc25..75379f6 100644
--- a/arch/x86/include/asm/numachip/numachip_csr.h
+++ b/arch/x86/include/asm/numachip/numachip_csr.h
@@ -34,6 +34,7 @@
#define NUMACHIP_LCSR_BASE 0x3ffffe000000ULL
#define NUMACHIP_LCSR_LIM 0x3fffffffffffULL
#define NUMACHIP_LCSR_SIZE (NUMACHIP_LCSR_LIM - NUMACHIP_LCSR_BASE + 1)
+#define NUMACHIP_LAPIC_BITS 8
static inline void *lcsr_address(unsigned long offset)
{
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index dfe2b1c..81bc216 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -95,9 +95,25 @@ static int numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip)
static void numachip_send_IPI_one(int cpu, int vector)
{
- int apicid = per_cpu(x86_cpu_to_apicid, cpu);
+ int local_apicid, apicid = per_cpu(x86_cpu_to_apicid, cpu);
unsigned int dmode;
+ preempt_disable();
+ local_apicid = __this_cpu_read(x86_cpu_to_apicid);
+
+ /* Send via local APIC where non-local part matches */
+ if (!((apicid ^ local_apicid) >> NUMACHIP_LAPIC_BITS)) {
+ unsigned long flags;
+
+ local_irq_save(flags);
+ __default_send_IPI_dest_field(apicid, vector,
+ APIC_DEST_PHYSICAL);
+ local_irq_restore(flags);
+ preempt_enable();
+ return;
+ }
+ preempt_enable();
+
dmode = (vector == NMI_VECTOR) ? APIC_DM_NMI : APIC_DM_FIXED;
numachip_apic_icr_write(apicid, dmode | vector);
}
@@ -217,6 +232,17 @@ static int numachip2_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
return 1;
}
+/* APIC IPIs are queued */
+static void numachip_apic_wait_icr_idle(void)
+{
+}
+
+/* APIC NMI IPIs are queued */
+static u32 numachip_safe_apic_wait_icr_idle(void)
+{
+ return 0;
+}
+
static const struct apic apic_numachip1 __refconst = {
.name = "NumaConnect system",
.probe = numachip1_probe,
@@ -262,8 +288,8 @@ static const struct apic apic_numachip1 __refconst = {
.eoi_write = native_apic_mem_write,
.icr_read = native_apic_icr_read,
.icr_write = native_apic_icr_write,
- .wait_icr_idle = native_apic_wait_icr_idle,
- .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
+ .wait_icr_idle = numachip_apic_wait_icr_idle,
+ .safe_wait_icr_idle = numachip_safe_apic_wait_icr_idle,
};
apic_driver(apic_numachip1);
@@ -313,8 +339,8 @@ static const struct apic apic_numachip2 __refconst = {
.eoi_write = native_apic_mem_write,
.icr_read = native_apic_icr_read,
.icr_write = native_apic_icr_write,
- .wait_icr_idle = native_apic_wait_icr_idle,
- .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
+ .wait_icr_idle = numachip_apic_wait_icr_idle,
+ .safe_wait_icr_idle = numachip_safe_apic_wait_icr_idle,
};
apic_driver(apic_numachip2);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 3/4] x86: Add Numachip IPI optimisations Daniel J Blueman <daniel@numascale.com> - 2015-09-20 19:20 +0200
csiph-web