Re: [PATCH] Replacing __SMP__ by CONFIG_SMP globally in linux-2.3.39.

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed Jan 12 2000 - 13:38:38 EST


On Wed, 12 Jan 2000, Niels Kristian Bech Jensen wrote:

> On Wed, 12 Jan 2000, Richard B. Johnson wrote:
>
> > What is its purpose? __SMP__ is not just defined or not defined from
> > the linux kernel source directory, but also used for writing modules
> > which, in fact, may not exist within the kernel source directory at
> > all.
> >
> > So, if such a patch goes into the kernel, module makefiles now have
> > to be modified to define "CONFIG_SMP" instead of "__SMP__" which,
> > since they may not even have a "configuration", becomes just another
> > PITA to support "change for the sake of change".
> >
> The purpose is to get rid of what I consider an ugly hack. Since
> CONFIG_SMP is a proper config option, it and only it should be used IMHO.
> What is the purpose of having a config option symbol (CONFIG_SMP) define
> another symbol (__SMP__) ?
>

The first to define a symbol makes the rule. How do you claim that
"CONFIG_SMP" is any more `proper` than "__SMP__" ?

If I changed the word automobile because I thought it was a misnomer
since there is, provably, nothing "auto" about it, do you think the
world would follow?

> External modules built for SMP kernels should already define CONFIG_SMP if
> they use any header files from the kernel, as CONFIG_SMP is used by some
> files under the linux/include directory. The change is that they don't
> need to define both __SMP__ and CONFIG_SMP.
>

A new rule? You say; "external modules built for SMP kernels should
already define CONFIG_SMP". Since when?

The only place CONFIG_SMP is defined is in the auto-generated
header file. It is not as you say, used by some files under
the linux/include directory. It's not used by any files up to version
2.3.36 in that directory.

Script started on Wed Jan 12 13:12:20 2000
# grep CONFIG_SMP /usr/include/linux/*.h
/usr/include/linux/autoconf.h:#define CONFIG_SMP 1
# exit
exit
Script done on Wed Jan 12 13:12:51 2000

...and it is used once in linux/asm as:

Script started on Wed Jan 12 13:22:23 2000
# grep CONFIG_SMP /usr/include/asm/*.h
/usr/include/asm/bugs.h:#if defined(CONFIG_X86_GOOD_APIC) && defined(CONFIG_SMP)
# exit
exit
Script done on Wed Jan 12 13:23:12 2000

So it looks as though there is a bug in /usr/include/asm/bugs.h. It should
read:

#if defined(CONFIG_X86_GOOD_APIC) && defined(__SMP__)

Then you can get rid of the unused generated CONFIG_SMP entirely.

Cheers,
Dick Johnson

Penguin : Linux version 2.3.36 on an i686 machine (400.59 BogoMips).

-
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.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:20 EST