From: Len Brown <lenb@kernel.org>
To: x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Len Brown <len.brown@intel.com>
Subject: [PATCH 3/4] x86 smpboot: remove SIPI delays from cpu_up()
Date: Sun, 16 Aug 2015 11:45:47 -0400 [thread overview]
Message-ID: <a5dfdbc8fbfdd813784da204aad5677fe459ac37.1439739165.git.len.brown@intel.com> (raw)
In-Reply-To: <1439739948-21028-1-git-send-email-lenb@kernel.org>
In-Reply-To: <33ef746c67d2489cad0a9b1958cf71167232ff2b.1439739165.git.len.brown@intel.com>
From: Len Brown <len.brown@intel.com>
MPS 1.4 example code shows the following delays during processor
on-line:
INIT
udelay(10,000)
SIPI
udelay(200)
SIPI
udelay(200) /* Linux actually implements this as udelay(300) */
Linux skips the udelay(10,000) on modern processors.
This patch removes the udelay(200) after each SIPI
on those same processors.
All three legacy delays can be restored by the cmdline
"cpu_init_udelay=10000".
As measured by analyze_suspend.py, this patch speeds
processor resume time on my desktop from 2.4ms to 1.8ms, per AP.
Signed-off-by: Len Brown <len.brown@intel.com>
---
arch/x86/kernel/smpboot.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 310b6f0..3d992b6 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -665,7 +665,8 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
/*
* Give the other CPU some time to accept the IPI.
*/
- udelay(300);
+ if (init_udelay != 0)
+ udelay(300);
pr_debug("Startup point 1\n");
@@ -675,7 +676,8 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
/*
* Give the other CPU some time to accept the IPI.
*/
- udelay(200);
+ if (init_udelay != 0)
+ udelay(200);
if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
apic_write(APIC_ESR, 0);
--
2.5.0.330.g130be8e
next prev parent reply other threads:[~2015-08-16 15:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-16 15:45 [PATCH 0/4] x86 smpboot: optimize cpu_up() a bit more Len Brown
2015-08-16 15:45 ` [PATCH 1/4] x86 smpboot: remove udelay(100) when polling cpu_initialized_map Len Brown
2015-08-16 15:45 ` [PATCH 2/4] x86 smpboot: remove udelay(100) when polling cpu_callin_map Len Brown
2015-08-16 15:45 ` Len Brown [this message]
2015-08-16 15:45 ` [PATCH 4/4] x86 smpboot: remove APIC.wait_for_init_deassert and atomic init_deasserted Len Brown
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=a5dfdbc8fbfdd813784da204aad5677fe459ac37.1439739165.git.len.brown@intel.com \
--to=lenb@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).