Re: SMP on assym. x86

Kurt Garloff
2001-03-22T12:05:32Z

[-- Attachment #1: Type: text/plain, Size: 2538 bytes --]

On Wed, Mar 21, 2001 at 11:41:33PM +0000, Alan Cox wrote:
> > > handle the situation with 2 different CPUs (AMP = Assymmetric
> > > multiprocessing ;-) correctly.
> >
> > "correctly". Intel doesn't support this (mis)configuration:
> > especially with different steppings, not to mention models.

I wouldn't call it misconfiguration, just because it's a bit more difficult
to handle.
On the iontel side: You should watch out for matching APICs, voltages and
cache coherency (MESI) protocol. Actually, Deschutes and Coppermine just
work fine in spite of slightly different voltage.

> Actually for a lot of cases its quite legal.

It should be always legal to have the same CPU with different speeds. (FSB
must be the same for obvious reasons), e.g.. The TSC part of the patch
addresses this.

> > Alan has, or is working on, a workaround to handle differing
> > multipliers by turning off the use of RDTSC. this is the right approach
> > to take in the kernel: disable features not shared by both processors,
> > so correctly-configured machines are not penalized.

TSC is supported by both CPUs ... so why not use the nice rdtsc based time
routine.
The penalty:
It is 5 (20 bytes) ints more in the struct cpuinfo_x86, so you have
a kernel with (NR_CPUS*20 - 12) = 628 bytes more kernel data ...
Your bootup time may be a fraction of a second longer, as every CPU
calibrates the TSC on its own; OTOH they do it in parallel ...
The timer interrupt does an extra copy of xtime (2 ints) to the to the per
CPU struct. And one extra indirection for accessing the per CPU struct.
Something like 4 CPU cycles per timer interrupt.
gettimeofday() also has this extra indirection; OTOH not accessing global
data saves a cache line flush the next time the structure is written to ...
So this is probably a net cost of zero.

> > and the kernel should LOUDLY WARN ABOUT this stuff on boot.
>
> I've been working on reading the multipliers directly from the MSR 0x2A data,
> Kurt is redoing the timing each run - possibly thats not so clean but its
> more robust.
>
> I rather like Kurt's patch

Thx!
If you have some requests to make it suitable for -ac kernels, I'll do my
best.

Regards,
--
Kurt Garloff <kurt@garloff.de> [Eindhoven, NL]
Physics: Plasma simulations <K.Garloff@Phys.TUE.NL> [TU Eindhoven, NL]
Linux: SCSI, Security <garloff@suse.de> [SuSE Nuernberg, FRG]
(See mail header or public key servers for PGP2 and GPG public keys.)

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]