# max no of CPUs = 2 causes modules load fail [SOLVED]

## PhiJ

I recompiled my kernal (changing CPU features and putting all changes directly into the kernel) and now on startup I get a modules error.  Then ALSA tries to load and locks.  If I skip ALSA on startup everything works fine.

I tried running make menuconfig, but I can't see what change I made that would have made the difference.

Oh, and the output in /var/log/everything/current that looks like it is the error I got is

 *Quote:*   

> Sep  4 08:50:35 [kernel] Freeing unused kernel memory: 360k freed
> 
> Sep  4 08:50:35 [kernel] BUG: unable to handle kernel paging request at ffffffff880061c0
> 
> Sep  4 08:50:35 [kernel] IP: [<ffffffff8024b2af>] load_module+0x91e/0x175c
> ...

 Last edited by PhiJ on Sat Sep 06, 2008 8:03 am; edited 2 times in total

----------

## d2_racing

Hi, did you run :

```

# make && make modules_install 

```

Also, maybe you should backup your .config and then run a make clean to reset your kernel config.

----------

## bastibasti

have you "make clean" before "make all"!?!?!??

----------

## PhiJ

I ran make menuconfig to do the changes originally, and then make && make modules_install to install them (possibly with a && exit on the end of that string).  No I didn't run make clean or make all.  No idea what all does, but I wanted to just tweak my previous config a little.

----------

## sundialsvc4

Be sure to make and keep backup-copies of your "/usr/src/linux/.config" (hidden... notice the leading ".") file.  This is where all your configuration-settings live.

You should keep a pristine copy of this "last known-good" configuration before making any changes.  It is also useful as a file that you can diff against the current configuration to see exactly what the differences are between the two.

When you change the kernel, it is imperative that you recompile everything.  Modules and all.  make clean will expunge any existing object-modules, thus forcing the next "make" to be complete.  (Some "make" commands will delete the configuration-file... hence the admonition to make pristine backup-copies frequently.  I have a directory dedicated to this purpose in "/root," and I immediately chmod the backups to make them read-only.)

Anytime you contemplate changing something as fundamental to your system as "the kernel," always have a fallback plan!

----------

## bastibasti

If you change anything on your kernel config (adding alsa etc) you need to "make clean" in order to delete old fragments of compiled code. This code has been compiled with the previous .config and might not work. I had the same problems with wireless.

----------

## PhiJ

Yay!  I found the problem:  Setting max CPUs to 2 (instead of 32) caused it.  I would like to know why that is though.  

As we're not meant to post multiple times about the same problem, I'm going to take a guess at how to change the subject of the thread to something more specific (is that allowed)?

Thanks for the hints everyone!

So. yes.  The question is now 

Changing the max number of supported cpus in my kernel to 2 from 32 causes an error on bootup, and ALSA can't load modules.  I have two CPUs (X2), so I don't see why this should be a problem.  Is there any way of fixing this and dropping the max number of CPUs to 2?

Oh, and the error message is quoted in my first post.

----------

## d2_racing

Maybe this kind of change make all the modules and the rest incompatible if they are not properly recompiled with the new setting.

----------

## bastibasti

That is exactly what I said. You cange a setting on the kernel core, and the modules become unstable. You HAVE TO run "make clean" before you run "make all" and then "make install" and "make modules_install"

----------

## PhiJ

Wait.. 'make all'?  'make install'?  I've been running 'make menuconfig', saving my configuration and then running 'make && make modules_install'.  Since being told about it I've run 'make clean' between 'make menuconfig' and 'make'.  That is right isn't it?  I don't need to run it again between 'make' and 'make modules_install' do I?  (from the little I understand of the two commands, that sounds like it may bust things.)

Edit: Oh, but when compiling my kernel, I noticed I had a few section mismatches, but I also had some when compiling it with max 32 cpus.  Don't know if it's relevant.

----------

## eccerr0r

Careful with options.  Some of the options require a full kernel rebuild and restart with the complete kernel, along with the modules.  Stuff like changing SMP or memory options potentially has impacts to the rest of the kernel especially in allocating space for buffers, etc., and cause incompatible modules.  A lot of these options change the include options file, and hence get propagated down into a lot of modules, causing incompatibility.

Are you booting the full, new kernel with the changed modules?  Do you have module versioning and mismatch warnings turned off or something?

As a rule of thumb, only options that are marked with <> you can potentially hit 'M' and rebuild modules without having to go through a full kernel compile.  If you have to hit Y or change a number to something with [] then all bets are off.

----------

## pappy_mcfae

All you need to enter to compile a kernel is make. That's it! After that, then you enter make modules_install. I never use make all or make install when I work with my kernels. I prefer to name my kernels and copy them manually. 

It's not that typing make all and make install is incorrect as much as it's a question of necessity. Make has made my kernels since I started playing with it under Slackware. Even though I can type 280 WPM with 96% accuracy, I'm still a lazy typist. Why type all those extra unnecessary letters?

Blessed be!

Pappy

----------

## PhiJ

Errr yes.  It was going to be a silly mistake wasn't it.  I never copied the bzImage over to the boot partition.  So it works now, and so do some minor problems I was going to post about after this one had been resolved.

----------

## bastibasti

dont understand, copy it over by hand? make install copies it over!?

----------

## d2_racing

Make install copy it over, but if you want to have the control, just use this kind of command :

```

# cd /usr/src/linux

# cp arch/i386/boot/bzImage /boot/kernel-2.6.26-Gentoo0-r1

```

----------

