Re: SMP code and uniprocessor

Mike A. Harris (mharris@ican.net)
Mon, 3 Aug 1998 10:03:34 -0400 (EDT)


On 3 Aug 1998, Joseph H. Buehler wrote:

> > It's safe for most machines, though every now and then an SMP kernel breaks
> > on UP. Supposedly there's a performance penalty, though.
> >
> > A few systems/motherboards won't work with an SMP kernel.
>
> How about replacing things like
>
> #ifdef __SMP__
>
> with
>
> if (__SMP__) {
>
> I.e., use a run-time check instead of a compile-time check. Then
> auto-detect an SMP machine at boot, or make it a kernel boot
> parameter. I currently have to recompile my RedHat kernel whenever I
> upgrade; it would be nice not to have to do that when 2.2 is ready.

That runtime "if" would occur in a lot of places in the kernel I
believe, and unnecessarily slow down things. Plus there are a
number of differences in what gets included in the kernel when
you compile for SMP or for UP. If the SMP code were in all the
time, and checked at runtime, there would be a tonne of kernel
bloat.

--
Mike A. Harris  -  Computer Consultant  -  Linux advocate

Escape from the confines of Microsoft's operating systems and push your PC to it's limits with LINUX - a real OS. http://www.redhat.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html