# Atom N330 - MSI IM-945GC kernel config for HT and network

## yesar

a week ago i got a new toy, a MSI IM-945GC but i have some problems with it...

the first wired thing is, it seems that HT is not properly working. i enabled it in bios (/proc/cpuinfo shows two) also tried turning it off and /proc/cpuinfo only shows one cpu   :Shocked: 

i tried different kernels (2.6.27-r8, 2.6.27-r10, 2.6.29-r1) with ACPI, APIC, SMP etc turned on, nothing moves this box to show 4 cpus...

i also got puppy's kernelseed 2.6.29-r1 but this brought another annoying problem up and didn't solve the HT problem...

the board has a rtl lan chip showing up as RTL8111/8168B so i used the r8169 driver. when i turned MSI (kernel -> pci ->) off everything seems fine expect that the gbit lan only do 30-40MB/s, but when i turn it on i got 60-70mb/s but the whole pc freezes in nearly 10 sec.

the driver from realtek didn't compile with kernel 2.6.29 either...

here is some info:

lspci -v: http://pastebin.com/f6c848988

dmesg: http://pastebin.com/f16c06863

the strange thing here is:

```

...

SMP: Allowing 4 CPUs, 2 hotplug CPUs

...

Total of 2 processors activated (6402.56 BogoMIPS).

...

```

emerge --info: http://pastebin.com/f4a96b174

kernel config: http://pastebin.com/f5ebc8080

hopefully someone can direct me in the right direction, i have no more ideas and i'm kind of frustrated...

----------

## TheAbu

Hum, I'm sorry, this won't really help you but you just solved a problem I had. I have the same box as you (but with the D945GCLF2 motherboard) and it started to freeze on heavy network transfer not long ago (also, reaching around 70 mb/s during about 20 seconds before collapsing -without MSI I'm at around 55-60 mb/s, enough). I really had no clue what was wrong until I read your post (you can't imagine how many thing I did, from downgrading samba to disassembling the computer to test the hard drives.

As a side note, I do see four cpu when doing "cat /proc/cpuinfo. Did you activate "SMT (Hyperthreading) scheduler support in the kernel ? (sorry, just saw, it's enabled in your kernel config)

Here is my kernel, if it can help you. Some things will be different since both motherboard are different, but maybe the processor part will be of use to you.

http://pastebin.com/d38058d18

----------

## yesar

thanks for your reply and i'm happy that you could solve your problem  :Smile: 

i was modifing your kernel config to fit my needs and found a "Hotplug cpu support" which rings some bells in reference to the kernel boot output from SMP.

so i checked /sys/devices/system/cpu:

```
drwxr-xr-x  5 root root    0 23. Apr 11:53 .

drwxr-xr-x 10 root root    0 23. Apr 11:53 ..

drwxr-xr-x  5 root root    0 23. Apr 11:53 cpu0

drwxr-xr-x  5 root root    0 23. Apr 11:59 cpu1

drwxr-xr-x  2 root root    0 23. Apr 11:53 cpuidle

-r--r--r--  1 root root 4096 23. Apr 11:53 kernel_max

-r--r--r--  1 root root 4096 23. Apr 11:53 offline

-r--r--r--  1 root root 4096 23. Apr 11:53 online

-r--r--r--  1 root root 4096 23. Apr 11:53 possible

-r--r--r--  1 root root 4096 23. Apr 11:53 present

-rw-r--r--  1 root root 4096 23. Apr 11:53 sched_mc_power_savings

-rw-r--r--  1 root root 4096 23. Apr 11:53 sched_smt_power_savings

```

now comes the wired thing:

'cat present' writes 0-1 but possible writes 0-3 but there are only cpu0 cpu1. i can en/disable cpu1 by 'echo 1/0 > cpu1/online' but i'm missing cpu2 & cpu3. i searched for hotplugging cpu but didn't find a way to activate a cpu not present in sysfs.

maybe this brings up some ideas whats wrong with my config...

i'll try now your kernel config, hopefully it brings up my two missing cpus...

----------

## TheAbu

Out of curiosity I replicated your commands on my system and I do get four cpu here too

```
drwxr-xr-x 5 root root    0 Apr 23 13:12 cpu0

drwxr-xr-x 5 root root    0 Apr 23 13:12 cpu1

drwxr-xr-x 5 root root    0 Apr 23 13:12 cpu2

drwxr-xr-x 5 root root    0 Apr 23 13:12 cpu3

drwxr-xr-x 2 root root    0 Apr 23 13:12 cpuidle

-r--r--r-- 1 root root 4096 Apr 23 13:12 kernel_max

-r--r--r-- 1 root root 4096 Apr 23 13:12 offline

-r--r--r-- 1 root root 4096 Apr 23 13:12 online

-r--r--r-- 1 root root 4096 Apr 23 13:12 possible

-r--r--r-- 1 root root 4096 Apr 23 13:12 present

-rw-r--r-- 1 root root 4096 Apr 23 13:12 sched_smt_power_savings

```

Both, present and possible read 0-3.

Here is my /proc/cpuinfo http://pastebin.com/d3ee6f7ae (I doubt it will be of any use though  :Sad:  )

I activated the hotplug cpu part to see if it could help solving my sleep problems (well, not mine but you get the point   :Laughing:  )

Oh, btw, if you don't already have that, you might want to try 

mtu_eth0="4000"

in your /etc/conf.d/net (provided your switch | router and other computers accept jumbo frames), it makes a difference of about 10-15 mb/s on my system (from around 45 to 60)

I really hope you get your missing cores back, I was surprised to see how well this little computer behave (and at first I almost bought a regular NAS, half the fun, twice the price)  :Smile: 

----------

## yesar

thanks for checking out the cpus on you system.

i looked at the log file while reactivating a cpu and this was confusing:

```
Apr 23 13:23:11 gatekeeper SMP alternatives: switching to SMP code

Apr 23 13:23:11 gatekeeper CPU 1 irqstacks, hard=c0635000 soft=c05f5000

Apr 23 13:23:11 gatekeeper Booting processor 1 APIC 0x1 ip 0x6000

Apr 23 13:23:11 gatekeeper Initializing CPU#1

Apr 23 13:23:11 gatekeeper Calibrating delay using timer specific routine.. 3201.71 BogoMIPS (lpj=5333937)

Apr 23 13:23:11 gatekeeper CPU: L1 I cache: 32K, L1 D cache: 24K

Apr 23 13:23:11 gatekeeper CPU: L2 cache: 512K

Apr 23 13:23:11 gatekeeper [ds] using Core 2/Atom configuration

Apr 23 13:23:11 gatekeeper CPU: Physical Processor ID: 0

Apr 23 13:23:11 gatekeeper CPU: Processor Core ID: 0

Apr 23 13:23:11 gatekeeper Intel machine check architecture supported.

Apr 23 13:23:11 gatekeeper Intel machine check reporting enabled on CPU#1.

Apr 23 13:23:11 gatekeeper CPU1: Intel(R) Atom(TM) CPU  330   @ 1.60GHz stepping 02

Apr 23 13:23:11 gatekeeper checking TSC synchronization [CPU#0 -> CPU#1]: passed.

Apr 23 13:23:11 gatekeeper Switched to high resolution mode on CPU 1

Apr 23 13:23:11 gatekeeper platform microcode: firmware: requesting intel-ucode/06-1c-02

Apr 23 13:23:11 gatekeeper firmware.sh[6388]: Cannot find  firmware file 'intel-ucode/06-1c-02'

```

am i missing the intel-ucode (kernel support? external driver? software package?) and how much influence has this on my problem? does the emerge hotplug can help or is this unsupported/deprecated because of udev?

anyway, i'll try the mtu option you wrote, i forgot that there is an option  :Wink: 

----------

## TheAbu

Do you have a wireless card on your box ? This firmware look a lot like something wireless related (but I could be totally wrong  :Smile:  )

My dmesg (the cpu part at least  :Smile:  )

```
[    0.003333] CPU: Processor Core ID: 0                                                 

[    0.003333] Intel machine check architecture supported.                               

[    0.003333] Intel machine check reporting enabled on CPU#2.                           

[    0.003333] x86 PAT enabled: cpu 2, old 0x7040600070406, new 0x7010600070106          

[    0.249310] CPU2: Intel(R) Atom(TM) CPU  330   @ 1.60GHz stepping 02                  

[    0.249511] checking TSC synchronization [CPU#0 -> CPU#2]: passed.                    

[    0.250144] Booting processor 3 APIC 0x3 ip 0x6000                                    

[    0.003333] Initializing CPU#3                                                        

[    0.003333] Calibrating delay using timer specific routine.. 3406.82 BogoMIPS (lpj=567

4916)                                                                                    

[    0.003333] CPU: L1 I cache: 32K, L1 D cache: 24K                                     

[    0.003333] CPU: L2 cache: 512K                                                       

[    0.003333] [ds] using Core 2/Atom configuration                                      

[    0.003333] CPU: Physical Processor ID: 0                                             

[    0.003333] CPU: Processor Core ID: 1                                                 

[    0.003333] Intel machine check architecture supported.                               

[    0.003333] Intel machine check reporting enabled on CPU#3.                           

[    0.003333] x86 PAT enabled: cpu 3, old 0x7040600070406, new 0x7010600070106

[    0.348489] CPU3: Intel(R) Atom(TM) CPU  330   @ 1.60GHz stepping 02

[    0.348647] checking TSC synchronization [CPU#0 -> CPU#3]: passed.

[    0.350039] Brought up 4 CPUs

[    0.350053] Total of 4 processors activated (12986.66 BogoMIPS).

[    0.350162] net_namespace: 508 bytes

[    0.350204] NET: Registered protocol family 16

[    0.353412] ACPI: bus type pci registered

[    0.353412] PCI: Found Intel Corporation 945G/GZ/P/PL Express Memory Controller Hub wi

thout MMCONFIG support.

[    0.355215] PCI: Using configuration type 1 for base access

[    0.360046] bio: create slab <bio-0> at 0

[    0.360811] ACPI: EC: Look up EC in DSDT

[    0.368129] ACPI: Interpreter enabled

[    0.368150] ACPI: (supports S0 S1 S3 S5)

```

I notice the middle line here is different :

[    0.003333] Intel machine check reporting enabled on CPU#3.                           

[    0.003333] x86 PAT enabled: cpu 3, old 0x7040600070406, new 0x7010600070106

[    0.348489] CPU3: Intel(R) Atom(TM) CPU  330   @ 1.60GHz stepping 02

----------

## yesar

there is no WLAN nic or other cards, it's just the mainboard, cpu, ram, hdd.

i tried your kernel config and sadly it doesn't change a thing regarding the cpus  :Sad:  I'm a bit helpless, don't know where to look for right/wrong configuration or what to do next  :Sad: 

----------

## TheAbu

Probably, a stupid suggestion, but did you try booting with system rescue cd to see how many cpu it detects ? If it also only detect 2 cpus, then the problem might need to be found somewhere else (hardware problem | bios setting). If you want to try it in 64 bit, you will need to get the beta version or you'll get a kernel panic. The problem being, with the beta version, if you try to mount a disk, then things goes wrong. If you don't care it being "only" 32 bit, then the latest non beta is fine, and it being gentoo based, it will give you a better view of things (if I boot using it, it does see my four cpus)

I'm pretty new to the linux world (about two real months) so, I think I'm also a bit helpless now  :Sad: 

----------

## yesar

i was thinking about a try in 64bit but i'm not sure if i need it. at the moment i'm fine with 32bit.

i emerged lshw and here comes the next strange thing, it shows 4 cpus...

```
lshw -class cpu

  *-cpu

       description: CPU

       product: Intel(R) Atom(TM) CPU  330   @ 1.60GHz

       vendor: Intel Corp.

       physical id: 4

       bus info: cpu@0

       version: 6.12.2

       serial: 0001-06C2-0000-0000-0000-0000

       slot: CPU 1

       size: 1600MHz

       capacity: 1600MHz

       width: 64 bits

       clock: 133MHz

       capabilities: boot fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx x86-64 constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm lahf_lm

       configuration: id=0

     *-logicalcpu:0

          description: Logical CPU

          physical id: 0.1

          width: 64 bits

          capabilities: logical

     *-logicalcpu:1

          description: Logical CPU

          physical id: 0.2

          width: 64 bits

          capabilities: logical

     *-logicalcpu:2

          description: Logical CPU

          physical id: 0.3

          width: 64 bits

          capabilities: logical

     *-logicalcpu:3

          description: Logical CPU

          physical id: 0.4

          width: 64 bits

          capabilities: logical

```

so where is this freaking setting to turn them on? i'm getting crazy with this...  :Sad: 

----------

## TheAbu

I also run 32 bit on the atom, with only 2GB, it doesn't really make sense switching to 64 bit in my opinion.

The probem you have is really weird, I do hope one of the guru who frequents this forum will have a look and an idea, I must admit it goes way beyond my (very) limited knowledge of linux now  :Sad:  I run funtoo, so my gentoo is ~x86 but I doubt it explains the difference since we both have the same kernel  :Sad: 

----------

## yesar

here is an update: i tried livecd-i686-installer-2008.0-r1 and install-x86-minimal-20090401 both showing only 2 cpus   :Crying or Very sad:  i also reseted the bios to optimized defaults (curiously at cpu features, HT was disabled) and enabled HT, boot up again but no change.

btw... my bios is V2.00 12232008

i'm out of ideas what to do...   :Sad: 

----------

## TheAbu

This is really strange  :Sad:  We would really need someone with the same motherboard to post to see if it's different than the one I have but now I really doubt it has anything to do with your configuration since you used some that are known to give the expected result  :Sad:  As a side note, I dual boot my atom with freeBSD and it also shows 4 processor too  :Sad: . 

The weirdest part is, your motherboard is more evolved than mine (in fact, it's the one I would have bought if it had been available in my country when I assembled my computer) so I really doubt it has less features than mine. Maybe there is something obvious that neither you or I see  :Sad: 

----------

## dakster

I've got a very similar mobo (D945GCLF2), and my hyperthreading and networking work. My networking was pretty hit or miss when I first got the board. This fixed itself when I updated the bios, so if you haven't already done that I'd suggest trying it. I don't have any special mtu settings or anything set. I'm using the in kernel network driver, and we have the same hardware:

# lspci

00:00.0 Host bridge: Intel Corporation 82945G/GZ/P/PL Memory Controller Hub (rev 02)

00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 01)

00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 01)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)

00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)

00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

I'm running 32 bit and currently using gentoo-sources-2.6.28-r5

For the relevant cpu and driver configs I've got the following set:

Processor Type and features->

Symmetric multi-processing support (Yes)

Processor family (Core 2/newer Xeon)

Maximum number of CPUs (4)

SMT (Hyperthreading) schedule support (Yes)

/dev/cpu/microcode -microcode support (Yes)

Intel microcode patch loading support (Yes)

Device Drivers->

Network device support->

Ethernet (1000 Mbit)->

Realtek 8169 gigabit ethernet support (yes)

I haven't had any problems with my networking in some time, even with older kernels using the in kernel 8169 driver. It was the bios update that seemed to fix it up for me, although mine would just not work at all on bootup sometimes. Maybe your cpu problem is bios related as well. Looking at the website for your mobo is says the original bios release was 2.05, and the updated version is 2.00?? Strange. However, you list the date on your bios as 12-23-2008, both of the bios on the website have 2009 dates:

http://www.msi.com/index.php?func=downloaddetail&type=bios&maincat_no=388&prod_no=1614

Sorry if I've missed something in the previous posts, I'm way too hungover to be paying much attention to detail this morning.

----------

## TheAbu

Hello, while configuring a gentoo (x86) I had an idea about your "firmware problem". It might be totally unrelated, but since I have no clue if it's relevant or not I better get it out anyway  :Smile: 

Among the driver settings you have a line "X86 Platform Specific Device Drivers (NEW) and here, among other things, you can see "WMI"

int the explanations, you can read "This driver is a required dependency to build the firmware specific drivers needed on many machines..." 

So, maybe something you need, not sure  :Smile: 

----------

## frenkel

yesar, can you post your kernel config please?

----------

