[PATCH] Add MAXCPU as a kernel config option and quality discussion on this

Peter Wemm peter at wemm.org
Fri Jul 8 17:51:32 UTC 2011


On Fri, Jul 8, 2011 at 8:37 AM, Attilio Rao <attilio at freebsd.org> wrote:
> I've made this patch for making MAXCPU a kernel config option:
> http://www.freebsd.org/~attilio/maxcpu_kernel_opt.diff

The problem with this is now you have to update all the kernel module
build glue to create opt_maxcpu.h, including 3rd party modules.

What about userland?

We have constructs like this:

amd64/include/reg.h:
#if defined(_KERNEL) && !defined(_STANDALONE)
#include "opt_compat.h"
#endif

Or even:
 #if defined(SMP) || defined(KLD_MODULE)
 #define MAXCPU		32
 #else
 #define MAXCPU		1
 #endif /* SMP || KLD_MODULE */

Putting opt_*.h references in include files is an invasive change and
something we've gone to a great deal of effort to avoid.

-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com; KI6FJV
"All of this is for nothing if we don't go to the stars" - JMS/B5
"If Java had true garbage collection, most programs would delete
themselves upon execution." -- Robert Sewell


More information about the freebsd-arch mailing list