Re: GRR!! SMP=1 sucks

David Wragg (dpw@doc.ic.ac.uk)
Thu, 9 Apr 1998 23:28:22 +0100


alan@lxorguk.ukuu.org.uk (Alan Cox) writes:
> > >SMP=1 isnt safe on some boxes.
> > Please tell me more about this.
>
> It looks for the APIC and it may not exist. I don't know any box that
> poking around for an invisible APIC crashes _but_...
>
> > >SMP=1 is upto 10% slower for single CPU
> > >on real tasks and 40% slower on certain FPU/sleep/FPU/sleep patterns
> >
> > Is this situation permanent or just a matter of some tuning
> > needing to be done (e.g, the granularity of some locks needing to be
> > adjusted)? I would hope, for example, that spin locks to do not
> > actually "spin" if there is only one CPU.
>
> Permanent. The FPU lazy restore doesnt work SMP

Yes, but for SMP kernels running on UP (or 1 cpu SMP boxes?) it
_would_ work, the kernel just doesn't know it. So can't this be fixed
by changing some "#ifndef __SMP__" lines to something like "if
(num_cpus == 1)", etc? It looks to me like any slowdown by this when
running truly SMP would be dwarfed by the improvement when running
SMP-but-not-really.

Perhaps if this was done, a __REALLY_SMP__ option should be added so
you could build a UP kernel, a one-size-fits-all kernel, or an
SMP-optimized kernel.

--
Dave Wragg

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu