Skip to contentSkip to conversation

2.6 timebase synchronization

PATCH In review Samuel Rydh 4 participants 8 messages Aug 8, 2003 – Aug 10, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6 timebase synchronization

Hi,

Here is a patch that provides improved generic SMP timebase synchronization for 2.6.

The calibration error is typically 0 ticks (at least on my machine). Without this patch, the difference is about 2 * 10^6 ticks...

/Samuel

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.998 -> 1.999
# arch/ppc/kernel/Makefile 1.51 -> 1.52
# arch/ppc/kernel/smp.c 1.35 -> 1.36
# (new) -> 1.1 arch/ppc/kernel/smp-tbsync.c
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/08 [email protected] 1.999
# SMP timebase synchronization
# --------------------------------------------
#

arch/ppc/kernel/Makefile +1 -1
diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
@@ -25,7 +25,7 @@
 obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_PCI)		+= pci-dma.o
 obj-$(CONFIG_KGDB)		+= ppc-stub.o
-obj-$(CONFIG_SMP)		+= smp.o
+obj-$(CONFIG_SMP)		+= smp.o smp-tbsync.o
 obj-$(CONFIG_TAU)		+= temp.o
 
 ifdef CONFIG_MATH_EMULATION
arch/ppc/kernel/smp-tbsync.c new file +187 -0

187 lines not on this page · raw message

arch/ppc/kernel/smp.c +1 -40

59 lines not on this page · raw message

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 6 lines · Samuel Rydh

Hi,

Here is a patch that provides improved generic SMP timebase synchronization for 2.6.

Attached is an improved version of the patch.

/Samuel

arch/ppc/kernel/Makefile +1 -1
diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
@@ -25,7 +25,7 @@
 obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_PCI)		+= pci-dma.o
 obj-$(CONFIG_KGDB)		+= ppc-stub.o
-obj-$(CONFIG_SMP)		+= smp.o
+obj-$(CONFIG_SMP)		+= smp.o smp-tbsync.o
 obj-$(CONFIG_TAU)		+= temp.o
 
 ifdef CONFIG_MATH_EMULATION
arch/ppc/kernel/smp-tbsync.c new file +181 -0

181 lines not on this page · raw message

arch/ppc/kernel/smp.c +1 -40

59 lines not on this page · raw message

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 9 lines · Samuel Rydh
Quoted 6 lines · Samuel Rydh

Hi,

Here is a patch that provides improved generic SMP timebase synchronization for 2.6.

Attached is an improved version of the patch.

I'm on vacation now, I can't test it until I'm back, but that looks quite good overall (except maybe the MacOS-like constant naming for kXXXX :)

However, does it work with more than 2 CPUs ? It seem to be rather dual CPU centric from my understanding of the ack mecanism... The TB sync code is also used on 4 CPU daystar machines and possibly some other chrp with more than 2 CPUs.

Paul, any comment ?

Ben.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 5 lines · Benjamin Herrenschmidt

I'm on vacation now, I can't test it until I'm back, but that looks quite good overall (except maybe the MacOS-like constant naming for kXXXX :)

However, does it work with more than 2 CPUs ?

Yes, it does. The code simply passes the timestamp from CPU0 to the one currently beeing booted (the CPU0 timebase is not affected).

Quoted 2 lines

It seem to be rather
dual CPU centric from my understanding of the ack mecanism...

Only a pair of CPUs are synchronized simultaneously, yes. But there is absolutely no need to synchronize more than two at the same. Besides, CPU2 is not started until CPU1 has booted...

/Samuel

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#4 lore raw
In reply to Samuel Rydh
Quoted 1 line · Samuel Rydh

Attached is an improved version of the patch.

How many SMP machines are there where we don't know how to freeze/thaw the timebase? We know how to do that on the old powersurge powermacs, on CHRP systems and on at least some of the recent core99 powermacs (those that have a timebase-enable property on the cpu device nodes). What machines are left?

Paul.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#5 lore raw
Quoted 9 lines · Paul Mackerras
Quoted 1 line · Samuel Rydh

Attached is an improved version of the patch.

How many SMP machines are there where we don't know how to freeze/thaw the timebase? We know how to do that on the old powersurge powermacs, on CHRP systems and on at least some of the recent core99 powermacs (those that have a timebase-enable property on the cpu device nodes). What machines are left?

We know how to do it on some core99, though we don't actually do it yet ;) We use software sync on all core99 for now.

Remaining are some older core99 machines, the 4-way DayStar oldworld machines, and afaik, that's all...

Ben.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#6 lore raw
Quoted 2 lines · Benjamin Herrenschmidt

Remaining are some older core99 machines, the 4-way DayStar oldworld machines, and afaik, that's all...

As always, my Daystar quad is around, and if you want/need testing on it just let me know. I also have a couple of Powersurge 2-way as well.

Mark (Gerk)

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#7 lore raw
In reply to Benjamin Herrenschmidt
Quoted 6 lines · Benjamin Herrenschmidt
Quoted 4 lines · Paul Mackerras
Quoted 1 line · Samuel Rydh

Attached is an improved version of the patch.

Quoted 8 lines
Quoted 5 lines

How many SMP machines are there where we don't know how to freeze/thaw the timebase? We know how to do that on the old powersurge powermacs, on CHRP systems and on at least some of the recent core99 powermacs (those that have a timebase-enable property on the cpu device nodes). What machines are left?

We know how to do it on some core99, though we don't actually do it yet ;) We use software sync on all core99 for now.

Btw, the freeze/thaw timebase setting that is done on psurge is lost since the generic timebase calibration mechanism is still invoked afterwards (and at that time, the timebases are ticking).

/Samuel

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/