Re: Why does this break under SMP?

H. Peter Anvin (
9 Sep 1997 20:00:41 GMT

Followup to: <>
By author: Bill Hawes <>
In newsgroup:
> Olaf Titz wrote:
> >
> > > this happened just enough times to do something about it. How hard is it
> > > to add an SMP/Uniprocessor flag to modules? [or is it already done ;)]
> >
> > What's needed is an SMP "flag" in <linux/version.h> in a form that can
> > be picked up at compile time. Perhaps like
> > #ifndef __SMP__
> > #error "SMP kernel needs compilation with __SMP__"
> > #endif
> > on SMP machines?
> The kernel and modules may have been compiled at different times.
> How about defining an external symbol in the kernel, kernel_is_SMP or
> kernel_is_UNI. Then have SMP modules refer to kernel_is_SMP, so you
> would get an undefined reference if you attempted to load a
> non-matching module.

That's part of it. Another part is that flags like this *NEED* to
make it into a header file (similar to module version numbers), so
that users don't have to specify a gazillion flags when compiling an
out-of-kernel-tree module. The current situation is really
unacceptable. -DMODVERSIONS is another such item; basically anything
that ends up getting specified with -D...

I did make a patch for this and sent to Linus, but he didn't like the
way I had hacked the Makefiles. I don't have time to redo it at this
point; maybe someone else wants to take a stab at it.


    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See for web page and full PGP public key
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see