DragonFly kernel List (threaded) for 2007-02
DragonFly BSD
DragonFly kernel List (threaded) for 2007-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

dynamic smp aware modules (was: Re: Multiple kernel building/installing)

From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Fri, 23 Feb 2007 01:37:44 +0100

YONETANI Tomokazu wrote:
On Thu, Feb 22, 2007 at 11:49:32PM +0100, Gergo Szakal wrote:
(did not want to pollute the commits list)
Does the last commit by corecode make it possivle to build/install an SMP and a non-SMP kernel together?

You've been able to *build* multiple kernels: make KERNCONF='GENERIC LINT' buildkernel but you couldn't install the kernels with different names.

Yes, that didn't change either. I just changed the infrastructure so that nrelease could build multiple kernels as well.

even if you install an SMP and non-SMP kernels with different names,
not all kernel modules can be shared -- at least any kernel modules
using spinlocks, such as nfs.ko and acpi.ko

I think we should change this. And actually it is quite easy. Replace

#ifdef SMP

	if (is_smp) {

and have some header doing

const static int is_smp =
# ifdef SMP
# else
# endif
extern const int is_smp;

and initialize is_smp appropriately in some kernel source.

The kernel will be compiled optimized, because the compiler knows that is_smp is a const value and thus can remove dead code. Modules will take the penalty of checking this variable, but that's hardly an impact, because it will be in the cache anyways. Just make sure that the variable is in its own cache line, which never changes.



Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]