Skip to contentSkip to conversation

fix dynticks for voyager

PATCH In review James Bottomley 4 participants 5 messages Apr 30, 2007 – May 2, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix dynticks for voyager

As usual voyager tripped over an explicit boot CPU is zero assumption in the dynticks code. This is the fix I have queued in the voyager tree.

James

---

Quoted 1 line

From 5d3e489cf8fcf12eff92476098b9bfa0120ee3c7 Mon Sep 17 00:00:00 2001

From: James Bottomley <[email protected]>
Date: Mon, 30 Apr 2007 11:27:25 -0500
Subject: [VOYAGER] clockevents: correct boot cpu is zero assumption

This isn't true for voyager, so alter setup_pit_timer() to initialise the cpumask from the current processor id (which should be the boot processor) rather than defaulting to zero.

---
 arch/i386/kernel/i8253.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/i386/kernel/i8253.c +1 -1
index 10cef5c..f8a3c40 100644
@@ -110,7 +110,7 @@ void __init setup_pit_timer(void)
 	 * Start pit with the boot cpu mask and make it global after the
 	 * IO_APIC has been initialized.
 	 */
-	pit_clockevent.cpumask = cpumask_of_cpu(0);
+	pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
 	pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32);
 	pit_clockevent.max_delta_ns =
 		clockevent_delta2ns(0x7FFF, &pit_clockevent);
Signature · 1 line
1.4.4.4
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · James Bottomley

As usual voyager tripped over an explicit boot CPU is zero assumption in the dynticks code. This is the fix I have queued in the voyager tree.

I expected some kind of voyager breakage. I desperately tried to find one for testing in my museum of bizarre hardware to avoid this, but ... :)

tglx

Quoted 7 lines

---

Quoted 1 line

From 5d3e489cf8fcf12eff92476098b9bfa0120ee3c7 Mon Sep 17 00:00:00 2001

From: James Bottomley <[email protected]>
Date: Mon, 30 Apr 2007 11:27:25 -0500
Subject: [VOYAGER] clockevents: correct boot cpu is zero assumption

Quoted 5 lines

This isn't true for voyager, so alter setup_pit_timer() to initialise the cpumask from the current processor id (which should be the boot processor) rather than defaulting to zero.

Quoted 17 lines
---
 arch/i386/kernel/i8253.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/i386/kernel/i8253.c +1 -1
index 10cef5c..f8a3c40 100644
@@ -110,7 +110,7 @@ void __init setup_pit_timer(void)
 	 * Start pit with the boot cpu mask and make it global after the
 	 * IO_APIC has been initialized.
 	 */
-	pit_clockevent.cpumask = cpumask_of_cpu(0);
+	pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
 	pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32);
 	pit_clockevent.max_delta_ns =
 		clockevent_delta2ns(0x7FFF, &pit_clockevent);
#2 lore raw
In reply to James Bottomley
Quoted 2 lines · James Bottomley

As usual voyager tripped over an explicit boot CPU is zero assumption in the dynticks code. This is the fix I have queued in the voyager tree.

Can we flush out all these assumptions by adding a constant offset somewhere? Or reversing the ordering?

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#3 lore raw
Quoted 9 lines · Matt Mackall
Quoted 3 lines · James Bottomley

As usual voyager tripped over an explicit boot CPU is zero assumption in the dynticks code. This is the fix I have queued in the voyager tree.

Can we flush out all these assumptions by adding a constant offset somewhere? Or reversing the ordering?

My understanding is that the boot CPU is random depending on who wins the "I get to boot" bunfight.

J

#4 lore raw
Quoted 9 lines · Jeremy Fitzhardinge
Quoted 8 lines · Matt Mackall
Quoted 3 lines · James Bottomley

As usual voyager tripped over an explicit boot CPU is zero assumption in the dynticks code. This is the fix I have queued in the voyager tree.

Can we flush out all these assumptions by adding a constant offset somewhere? Or reversing the ordering?

It might be useful to voyager, but unless the offset were random, people would simply hardwire it.

Quoted 2 lines

My understanding is that the boot CPU is random depending on who wins the "I get to boot" bunfight.

Not quite. On apic systems, the boot CPU can be an arbitrary physical id but is conventionally logical id 0. On voyager, the CPU id actually maps to a fixed location, so there's no sense in having a logical id. The booting CPU on voyager is simply the lowest numbered CPU that comes up through the SUS boot.

James