Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1208249

[PATCH 1/4] x86 smpboot: remove udelay(100) when polling cpu_initialized_map

From Len Brown <lenb@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 1/4] x86 smpboot: remove udelay(100) when polling cpu_initialized_map
Date 2015-08-16 17:50 +0200
Message-ID <pY8m5-4qj-15@gated-at.bofh.it> (permalink)
References <pY8m5-4qj-9@gated-at.bofh.it>
Organization Intel Open Source Technology Center

Show all headers | View raw


From: Len Brown <len.brown@intel.com>

After the BSP sends the APIC INIT/SIPI/SIPI to the AP,
it waits for the AP to come up and indicate that it is alive
by setting its own bit in the cpu_initialized_mask.

Linux polls for up to 10 seconds for this to happen.
Each polling loop has a udelay(100) and a call to schedule().

The udelay(100) adds no value.

For example, on my desktop, the BSP waits for the
other 3 CPUs to come on line at boot for 305, 404, 405 usec.
For resume from S3, it waits 317, 404, 405 usec.

But when the udelay(100) is removed, the BSP waits
305, 310, 306 for boot, and 305, 307, 306 for resume.

So for both boot and resume, removing the udelay(100)
speeds online by about 100us in 2 of 3 cases.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 arch/x86/kernel/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index b1f3ed9c..9ad88fb 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -898,7 +898,7 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
 
 	if (!boot_error) {
 		/*
-		 * Wait 10s total for a response from AP
+		 * Wait 10s total for first sign of life from AP
 		 */
 		boot_error = -1;
 		timeout = jiffies + 10*HZ;
@@ -911,7 +911,6 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
 				boot_error = 0;
 				break;
 			}
-			udelay(100);
 			schedule();
 		}
 	}
-- 
2.5.0.330.g130be8e

--
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 — Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] x86 smpboot: remove udelay(100) when polling cpu_initialized_map Len Brown <lenb@kernel.org> - 2015-08-16 17:50 +0200
  [tip:x86/boot] x86/smpboot: Remove udelay(100)   when polling cpu_initialized_map tip-bot for Len Brown <tipbot@zytor.com> - 2015-08-17 18:30 +0200

csiph-web