Gentoo Linux on a Dell Inspiron 640m | <<< index of Linux |
The following is a collection of veteran notes on configuring a Gentoo system system for an Dell Inspiron 640m. A variety of peripherals are included that are not specific to this machine, but have been interfaced with it. These notes are only intended for the Linux veteran looking to configure their OS on an Intel Core 2 Duo laptop, but should be useful for novices as well.
If you want more details, or I am unclear on something, please do E-mail me. But if you don't understand something for lack of background, I suggest you google for explanations or post to the Gentoo - Kernel & Hardware forum.
NOTE: This document is a work-in-progress with frequent additions/modifications. Relevant contributions or requests via E-mail are very welcome. Starting a thread on Gentoo Forums and sending me an email would be even better.
DISCLAIMER: If you don't know what you're doing, then don't do it! You could permanently damage your laptop. I disavow all responsibility for how these notes are used and provide no warranty for their accuracy. Also, most implicit or explicit recommendations—statements that say "… recommended to …"—are of a subjective nature, and are simply my personal recommendation(s) from engaging in developer mailing list discussions plus detailed experimentation with this particular machine. For example, compiling most drivers as modules is an approach emphasized by this document; but that may or may not be considered a best-results method by various kernel developers, as there are multiple valid approaches to configuring the Linux kernel.
Dell identifies this particular Inspiron model as a Dell Inspiron 640m/E1405. Marketing specifications of the particular Inspiron 640m model used for this document:
Specifically from a Linux driver perspective, this machine is a second-generation Core 2 Duo without 64-bit extensions BIOS support, with Virtualization extensions BIOS support, Intel combined SATA/PATA with AHCI, BIOS not supporting AHCI, ICH7 family motherboard, synaptics touchpad, 100% maximum RAM capacity (2 GB of 2 GB).
A few unusually progressive design characteristics found in this machine, especially for a circa-2007 laptop, include:
The processor identifies itself as an Intel T7200. The 4 MB L2 cache is shared between the two cores.
# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz
stepping : 6
cpu MHz : 2000.000
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni
monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3994.33
clflush size : 64
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz
stepping : 6
cpu MHz : 2000.000
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni
monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3991.06
clflush size : 64
# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
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.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (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 Mobile PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
02:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)
02:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
02:01.1 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
02:01.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)
02:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
02:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)
0c:00.0 Network controller: Broadcom Corporation Dell Wireless 1390 WLAN Mini-PCI Card (rev 01)
# lsusb
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 046d:c501 Logitech, Inc. Cordless Mouse Receiver
Bus 001 Device 003: ID 413c:2005 Dell Computer Corp.
Bus 001 Device 002: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 0000:0000
# hdparm -I /dev/sda | grep 'Model\|Firmware'
Model Number: WDC WD1200BEVS-75RST0
Firmware Revision: 04.01G04
# dmesg | sed 's/\[[ 0-9.]*\] //' | grep '^\(scsi\|ata\|sr\|sg\|sd\|ide\|libata\)'
libata version 2.20 loaded.
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ata_piix 0000:00:1f.2: version 2.10ac1
ata_piix 0000:00:1f.2: MAP [ P0 P2 IDE IDE ]
ata1: SATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x0001bfa0 irq 14
ata2: PATA max UDMA/100 cmd 0x00010170 ctl 0x00010376 bmdma 0x0001bfa8 irq 15
scsi0 : ata_piix
ata1.00: ATA-7: WDC WD1200BEVS-75RST0, 04.01G04, max UDMA/133
ata1.00: 234441648 sectors, multi 8: LBA48 NCQ (depth 0/32)
ata1.00: configured for UDMA/133
scsi1 : ata_piix
ata2.00: ATAPI, max UDMA/33
ata2.00: configured for UDMA/33
scsi 0:0:0:0: Direct-Access ATA WDC WD1200BEVS-7 04.0 PQ: 0 ANSI: 5
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
sd 0:0:0:0: Attached scsi disk sda
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: CD-ROM HL-DT-ST DVD+-RW GSA-T11N A103 PQ: 0 ANSI: 5
sr0: scsi3-mmc drive: 24x/24x writer cd/rw xa/form2 cdda tray
sr 1:0:0:0: Attached scsi CD-ROM sr0
sr 1:0:0:0: Attached scsi generic sg1 type 5
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci: SDHCI controller found at 0000:02:01.1 [1180:0822] (rev 19)
ata1.00: configured for UDMA/133
ata1: EH complete
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
Here are links to a few data sheets relevant to components found within this laptop.
The console frame buffer needs to be compiled into the kernel or loaded from an initramfs. Most predictable results when the driver is compiled-in and the video mode is explicitly passed via the kernel command line. Native driver intelfb is supposed to support this chipset; however, dmesg shows a loading error of not being able to acquire the AGP bus at any setting; and as such, it does not work. Both VESA drivers, the vanilla vesafb, and the out-of-tree vesafb-tng operate correctly; but vesafb-tng does a better job of resuming the LCD from suspend and appears to have a better refresh rate. Both VESA drivers have a nasty habit of locking up the kernel during one of every few boots due to what appears to be an ACPI or PCI-E error; and disabling EDID does not solve the issue.
Splash boot does work with the Gentoo kernel patches and splashutils-1.4.3. However, it appears to very occasionally cause the kernel to deadlock on boot; more frequently when initializing a silent splash than when initializing a verbose splash. This is irrespective of the VESA driver or video mode.
/boot/grub/grub.conf
# example bootsplash options with splash_geninitramfs initramfs
kernel /boot/vmlinuz-2.6.22 root=/dev/sda1 console=tty1 splash=verbose,theme:livecd-2007.0
# zgrep '^CONFIG_FB' /proc/config.gz
CONFIG_FB=y
CONFIG_FB_DDC=m
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_VESA=y
CONFIG_FB_VESA_TNG=y
CONFIG_FB_VESA_DEFAULT_MODE="1024x768-32@60"
CONFIG_FB_INTEL=m
CONFIG_FB_INTEL_DEBUG=y
CONFIG_FB_INTEL_I2C=y
CONFIG_FB_SPLASH=y
As of kernel 2.6.22—which demonstrates these issues even more than 2.6.21—a 100% reliable boot-up without ever deadlocking is possible, but complex to diagnose and configure; this is discussed in another section below. The ideal video mode is:
/boot/grub/grub.conf
# example reliable vesafb-tng mode for kernel 2.6.22
kernel /boot/vmlinuz-2.6.22 root=/dev/sda1 video=vesafb:nocrtc,noedid,gtf,ywrap,1024x768-32@60
For X11, the Intel Mobile 950GMA video card uses the driver intel and either intel or i810 may be specified in the configuration file. This is not to be confused with the predecessor driver that was actually named i810. For real hardware acceleration (DRM), either the vanilla 2.6 kernel driver i915 may be used, or the external DRM kernel driver i915 located in the xorg CVS tree. The 2.6.22 kernel driver provides adequate 2D and 3D acceleration. The x11-drm-20070314 drivers work better as it is a significantly newer version. (The xorg DRM source is merged infrequently to the kernel tree.)
xorg-x11-7.2 plus an update to at least xorg-server-1.3.0.0 and x11-drivers/xf86-video-i810-2.0.0 is able to auto-detect the native panel display resolution without using any video BIOS hacks. Older drivers require use of 915resolution to obtain native display resolution in X11 by a soft-patching of the video BIOS. The 2.0 intel driver is preferable also for its superior handling of resuming the LCD from ACPI suspend, and native support of video outputs with Xrandr extension.
/etc/X11/xorg.conf
# 14'' Dell 640m low-res display
Section "Monitor"
Identifier "Monitor0"
Option "DPMS" "true"
Modeline "1280x800" 71.0 1280 1328 1360 1440 800 803 809 823
EndSection
External video ports work by use of the x11-apps/xrandr application, a virtual resolution with Xinerama support disabled, and a generic monitor configuration. A virtual resolution higher than 2048 by 2048 is not supported by the driver due to hardware limitations of the GMA950; and this can cause complications when attempting dual-head operation.
/etc/X11/xorg.conf
# 950 setup for xorg-server 1.3
Section "Monitor" # Generic Plug-and-Play
Identifier "PNP"
Option "DPMS"
EndSection
Section "Device"
Identifier "Card0"
Driver "intel"
BusID "PCI:0:2:0"
Option "DRI" "true"
Option "SWcursor" "false"
# Option "PageFlip" "true"
Option "Legacy3D" "false"
Option "AperTexSize" "65536"
Option "AccelMethod" "EXA"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "PNP"
DefaultDepth 24
SubSection "Display"
Depth 24
# Driver is not capable of higher total resolution,
# and so left/right dual-head with large screen is not
# possible. Dual-head with monitors above/below is possible.
Virtual 2048 2048
EndSubSection
EndSection
# man intel
# man xrandr
Xorg 7.2 with server 1.3 config for 950 GMA using xrandr (md5) (asc)
With the preceeding configuration and i915 from x11-drm-20070314 loaded in the kernel, glxgears peaks at over 1500 FPS. Also, the kernel needs to have AGP, i801 I2C, and possible PCI-E support for full acceleration of the video card.
# zgrep '^CONFIG_\(DRM\|AGP\|DRM\|I2C\|PCIE\)' /proc/config.gz
CONFIG_PCIEPORTBUS=y
CONFIG_PCIEAER=y
CONFIG_AGP=m
CONFIG_AGP_INTEL=m
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_I801=m
# USE="dri nptl sdl xorg" VIDEO_CARDS="i810 vesa intel fbdev dummy vga" INPUT_DEVICES="synaptics evdev keyboard mouse" \
emerge ~x11-base/x11-drm-20070314 ~x11-libs/libdrm-2.3.0 ~x11-base/xorg-server-1.3.0.0 ~x11-drivers/xf86-video-i810-2.1.0 \
~media-libs/mesa-6.5.2 ~x11-apps/mesa-progs-6.5.2
Assuming that gnome-base/gdm is used as the Display Manager, then the following addition to gdm's initialization script will prefer use of the VGA output port over the internal LVDS whenever the VGA port is found to be connected. The application x11-apps/grandr also provides a friendly GUI for configuring the monitor outputs. (TV output appears available, but is untested at the moment.)
/etc/X11/gdm/Init/Default
xrandr -q | grep -q 'VGA connected' && xrandr --output LVDS --off && xrandr --output VGA --preferred
The sound card model is new enough that there appears to be only an ALSA driver (and no deprecated OSS driver). Recommend that driver itself is always built as a module. This way, the soundcard may be powered down or reset by unloading the module, if so desired.
# zgrep '^CONFIG_SND' /proc/config.gz
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_RTCTIMER=m
CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_AC97_CODEC=m
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_INTEL8X0M=m
CONFIG_SND_INTEL8X0=m
CONFIG_SND_AC97_POWER_SAVE=y
CONFIG_SND_USB_AUDIO=m
# lsmod | grep snd
snd_pcm_oss 44064 0
snd_mixer_oss 17088 1 snd_pcm_oss
snd_seq_oss 32832 0
snd_seq_midi_event 7552 1 snd_seq_oss
snd_seq 52944 4 snd_seq_oss,snd_seq_midi_event
snd_seq_device 8460 2 snd_seq_oss,snd_seq
snd_hda_intel 22040 1
snd_hda_codec 233556 2 hsfhda,snd_hda_intel
snd_pcm 80388 3 snd_pcm_oss,snd_hda_intel,snd_hda_codec
snd_timer 23748 2 snd_seq,snd_pcm
snd 53540 11 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
soundcore 8352 1 snd
snd_page_alloc 10120 2 snd_hda_intel,snd_pcm
/etc/modules.d/alsa
alias char-major-116 snd
alias char-major-14 soundcore
alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss
options snd cards_limit=1
The keyboard's keycodes all load correctly and automatically. Magic SysRq works. The ACPI keys of power and standby are processed as ACPI events and should be handled by sys-power/acpid. Some of the media buttons are visible with x11-apps/xev, and their keycodes may be used for custom bindings depeding upon the X11 window manager or desktop environment.
# zgrep ^CONFIG.*KEYBOARD /proc/config.gz
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ATKBD=y
/etc/X11/xorg.conf
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
The interal touchpad behaves as a PS2 mouse, and appears to use the driver psmouse.
# zgrep '^CONFIG.*\(INPUT_EV\|MOUSE\|HID\b\)' /proc/config.gz
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_EVDEV=m
CONFIG_INPUT_EVBUG=m
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=m
CONFIG_HID=m
CONFIG_USB_HID=m
# grep evbug /etc/modprobe.d/blacklist
blacklist evbug
To use an external USB mouse, the kernel module usbhid must be loaded or compiled-in. udev may automate loading of the module on some systems. An adequate work-around for troublesome USB mice (and keyboards) is to compile the module usbhid as a module rather that compiled-in, and reload as necessary.
# modprobe -r usbhid
# modprobe usbhid
Most versions of X11 support the synaptics touchpad driver either automatically or with minimal configuration. The following is a more detailed configuration to enable on-the-fly adjustment of the touchpad, and simultaenous USB mouse and touchpad.
/etc/X11/xorg.conf
Section "InputDevice"
Identifier "Synaptics"
Driver "synaptics"
Option "Protocol" "raw"
Option "Device" "/dev/input/mice"
Option "SendCoreEvents" "true"
Option "UseSHM" "true"
Option "SHMConfig" "true"
# disable tap initially
Option "MaxTapTime" "0"
EndSection
Section "InputDevice"
Identifier "USB Mouse"
Driver "mouse"
Option "Protocol" "Auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Button" "false"
EndSection
Section "ServerLayout"
Identifier "Default"
Screen "Screen0"
InputDevice "Synaptics" "AlwaysCore"
InputDevice "USB Mouse" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "ServerFlags"
Option "AllowMouseOpenFail" "true"
Option "DefaultServerLayout" "Default"
EndSection
Using commands provided by x11-drivers/synaptics, the touchpad behavior can be enhanced as follows:
syn-setup.sh
#!/bin/bash
# disable touchpad scrolls when typing
if [[ -e ~/.syndaemon.pid ]]; then
kill $(< ~/.syndaemon.pid) 2>/dev/null
fi
syndaemon -i 2.0 -d -p ~/.syndaemon.pid -t -k
# disable tap-as-click on touchpad
synclient MaxTapTime=0
Simple script to modify synaptics touchpad behavior. (md5) (asc)
# man synclient
# man syndaemon
Various kernel settings are necessary for the combined Serial ATA and Parallel ATA controller to operate both SATA and PATA devices at full ATA speed. The new libata drivers should be compiled, and the old block ide/atapi drivers are best omitted. Also, any and all generic ATA or IDE support is best omitted, though it does not appear to cause issues as of kernel 2.6.21. The obsolete block ide serial ata drivers (non-libata) should not be enabled. Note that this is a potentially confusing point. There exists: block ide support, which is unnecessary; the serial ata drivers which are required; the drivers that call themselves ide serial ata which are important to omit.
# zgrep '^CONFIG_\([PS]\?ATA\|IDE\|SCSI\)' /proc/config.gz
CONFIG_IDE=y
CONFIG_SCSI=y
CONFIG_SCSI_WAIT_SCAN=y
CONFIG_ATA=y
CONFIG_ATA_ACPI=y
CONFIG_SATA_AHCI=y
CONFIG_ATA_PIIX=y
# zgrep '^CONFIG_BLK_DEV_\(IDE\|S[DR]\|PII\)' /proc/config.gz
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=m
The chipset for this laptop does support AHCI according to the Intel datasheet. However, the Dell BIOS is fixed for non-AHCI operation, unfortunately, likely causing significantly poorer hard drive performance than other vendor's laptops. For example, some of the HP laptop BIOS do have AHCI support with this exact same chipset.
The internal hard disk can be tuned for performance beyond the default boot-time settings. Using hdparm, the following settings ensure that the drive is configured for improved performance. Another option that is desirable to try is changing the multiple sector I/O mode; however, libata does not support the nessecary ioctl's as of kernel 2.6.22.
# grep ^sd /etc/conf.d/hdparm
sda_args="-A1 -W1 -M254"
# man hdparm
Note that these hard drive settings, while likely compatible with all laptop hard drive makes and models, are specific for optimizing the WD Scorpio 120 GB SATA Hard Drive. For example, enabling write cache with -W1 could have damaging effects with some drives.
To force the optical drive to use DMA it is necessary to tell the kernel to use the SATA driver in combined mode. Otherwise, the SATA driver takes control of the ICH7 IDE Controller and the PATA driver is unable to operate the optical driver except in non-DMA PIO mode, which is very slow and inefficient. Instead, the kernel must know that a single ICH7 controller operates both the SATA and PATA devices, as is the case with this 82801GBM/GHM SATA IDE Controller. In either case, configuring the optical drive with hdparm is ineffective.
/boot/grub/grub.conf
# example libata options for combined ICH7 controllers
kernel /boot/vmlinuz-2.6.22 root=/dev/sda1 combined_mode=libata libata.atapi_enabled=1
With newer kernel versions, the CFQ scheduler plus XFS appears to have the very best general system performance. EXT3 might still be good for the base system simply due to its being the most tested file system with the kernel's laptop mode setting. (Otherwise, manually tuning XFS should be ideal.) reiserfs or reiser4 are likely to provide the best portage/ccache, home directory, and mail directory performance; but probably not as good over-all system management, especially with respect to LVM2. ext3, reiserfs and XFS have the advantages of being easily resizable for use with LVM2. And XFS has the most thorough on-demand defragmentation support; although such a feature is generally unnecessary with a well-kept Linux system.
# zgrep '^CONFIG.*\(IOSCHED\|CFQ\|XFS\|REIS\|EXT[23]\)' /proc/config.gz
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=m
CONFIG_IOSCHED_DEADLINE=m
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_CFQ=y
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT3_FS=m
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_REISERFS_FS=m
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_XFS_FS=y
CONFIG_XFS_POSIX_ACL=y
# zgrep '^CONFIG.*_\(DM\|MD\)[_=]' /proc/config.gz
CONFIG_MD=y
CONFIG_BLK_DEV_DM=m
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
CONFIG_DM_ZERO=m
CONFIG_BLK_DEV_DM_BBR=m
The laptop contains a dual USB 1.1 and 2.0 controller.
The USB driver uhci_usb provides USB 1.1 support while the USB driver ehci_usb provided USB 2.0 support. Compiling the drivers as modules or into the kernel yeilds good results. The driver ohci_usb is not applicable to this Intel chipset.
# zgrep '^CONFIG_USB.*\(=\|PRINTER\)' /proc/config.gz | grep -v '_SERIAL_'
CONFIG_USB_HID=m
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=m
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_OHCI_HCD=m
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_PRINTER=m
CONFIG_USB_STORAGE=m
CONFIG_USB_LIBUSUAL=y
CONFIG_USB_MON=y
CONFIG_USB_SERIAL=m
CONFIG_USB_EZUSB=y
To make full use of 3rd-party device-specific drivers, many more drivers may be necessary to compile as modules and load at boot time. The listed configuration is sufficient for the Inspiron alone, plus external generic USB mouse, keyboard, printer, scanner, hub, but not including Bluetooth.
The kernel should automatically support the Firewire port. The 1394 base drivers could be compiled as modules or in the kernel; but it is recommended compile the supporting 1394 drivers (video, DVB , etc.) as modules. Also, blacklisting the 1394 ethernet driver will prevent udev from automatically loading it (otherwise it may steal eth1 prior to the wifi card).
# zgrep '^CONFIG.*1394' /proc/config.gz
CONFIG_IEEE1394=m
CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
CONFIG_IEEE1394_OHCI1394=m
CONFIG_IEEE1394_SBP2=m
CONFIG_IEEE1394_ETH1394=m
CONFIG_IEEE1394_RAWIO=m
# grep 1394 /etc/modprobe.d/blacklist
blacklist eth1394
With kernel 2.6.22 a newer firewire stack was introduced to the kernel. udev may or may not support auto-loading of the driver, depending on the system configuration. It should not be attempted to compile both stacks into the kernel. The newer 2.6.22 stack only offers general Firewire device support, and not ethernet over firewire. Module firewire-ohci provides the general Firewire support, and module firewire-sbp2 provides external disk support.
# zgrep '^CONFIG_FIRE.*' /proc/config.gz
CONFIG_FIREWIRE=m
CONFIG_FIREWIRE_OHCI=m
CONFIG_FIREWIRE_SBP2=m
The kernel supports the MMC/SD card reader with module sdhci. It is recommended to compile MMC/SD drivers as modules. The card should appear as a block device of the pattern /dev/mmc*, regardless if the card is MMC or SD. udev support is desirable.
# zgrep ^CONFIG_MMC /proc/config.gz
CONFIG_MMC=m
CONFIG_MMC_BLOCK=m
CONFIG_MMC_SDHCI=m
CONFIG_MMC_WBSD=m
CONFIG_MMC_TIFM_SD=m
The MMC and SD standards specify that these cards only use the FAT or FAT32 file systems. (Obviously the user can do what they want given the proper tools and no need for interoperability.)
# zgrep '^CONFIG_\(V\?FAT\|MSDOS\)' /proc/config.gz
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
CONFIG_MSDOS_PARTITION=y
An example of the new block devices upon inserting an SD memory card into the reader:
# /bin/ls -F -l /dev/mmc*
brw-rw---- 1 root disk 254, 0 2007-05-30 16:17 /dev/mmcblk0
brw-rw---- 1 root disk 254, 1 2007-05-30 16:17 /dev/mmcblk0p1
# sudo mount -t vfat /dev/mmcblk0p1 /media/card
The xD-Picture Card reader appears to be unsupported by Linux due to the proprietary nature and lower availability/demand of this technology.
A few references on Linux and xD-Picture Card:
The Memory Stick reader appears to be unsupported by Linux due to the proprietary nature of this technology.
Support for the Memory Stick does appear to be under development, but not even close to complete; possibly to be later merged with the MMC driver tifm.
The kernel should automatically support the ExpressCard slot by enabling both PCI-E support and PCI hotplugging. The slot should act just like a hot-plugged PCI Express card slot on a desktop, but with electrical support for hot-plugging. Unlike a PCMCIA / Card Bus slot, this should only need udev in the userspace and any necessary kernel drivers for the inserted card. Some documentation suggests that kernel Card Bus support and Yenta chipset should be enabled due to the need for the PCMCIA subsystem within the kernel. (Note that this is not a Card Bus or PCMCIA slot.)
# zgrep '^CONFIG.*\(PCIE\|HOTPLUG_PCI\)' /proc/config.gz
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
CONFIG_PCIEAER=y
CONFIG_HOTPLUG_PCI=m
CONFIG_HOTPLUG_PCI_ACPI=m
# zgrep '^CONFIG_\(PCMCIA.*=y\|CARD\|YENTA\)' /proc/config.gz
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_CARDBUS=y
CONFIG_YENTA=m
CONFIG_YENTA_O2=y
CONFIG_YENTA_RICOH=y
CONFIG_YENTA_TI=y
CONFIG_YENTA_ENE_TUNE=y
CONFIG_YENTA_TOSHIBA=y
By default, Gentoo uses the DHCP client net-misc/dhcpcd. Much more configurable networking can be obtained by using the ubiquitous ISC DHCP client dhclient from the net-misc/dhcp ebuild.
# cat /etc/dhcp/dhclient.conf
# a huge number of DHCP options can go here
send host-name "myname";
# man dhclient.conf
/etc/conf.d/net
modules=( "dhclient" )
config_eth0=( "dhcp" )
dhclient_eth0=("-q -cf /etc/dhcp/dhclient.conf")
For predictable behavior, the Ethernet driver should be compiled directly into the kernel, not as a module; or it should be compiled as a module and loaded from the initramfs. This is an important way to guarantee the device to be the first interface discovered at bootup, and thus to always be assigned as device eth0 without any renaming tricks.
# zgrep '^CONF.*\(MII\|B44\)' /proc/config.gz
CONFIG_MII=y
CONFIG_B44=y
DHCP works the same way for each interface, so in addition to the above Ethernet configuration:
/etc/conf.d/net
config_eth1=( "dhcp" )
dhclient_eth1=("-q -cf /etc/dhcp/dhclient.conf")
The bcm43xx driver first appears in the official 2.6.17 kernel, using the softmac 802.11 stack. A newer stack from devicescape is introduced with kernel 2.6.22, but the bcm43xx driver does not yet use the newer stack unless custom patched. The primary advantage of devicescape over softmac is an increase in available features, including WPA and WPA2.
The bcm43xx is best compiled as a module if the driver has trouble initializing your specific chip version after hardware suspend, or shows any other form of misbehavior. For the chip model 4311 with firmware extracted from Windows XP 4311 drivers, the native linux driver was able to operate correctly starting with kernel 2.6.21. This driver co-operates fairly well with the Dell wifi enable/disable BIOS key (Fn-F2). Disabling the wifi via the key press and then enabling not too much later should work seemlessly. Disabling for a long time will probably require a restart of the net.eth1 service.
# zgrep '^CONF.*\(FW\|80211\|BCM43XX\)' /proc/config.gz
CONFIG_IEEE80211=m
CONFIG_IEEE80211_CRYPT_WEP=m
CONFIG_IEEE80211_CRYPT_CCMP=m
CONFIG_IEEE80211_CRYPT_TKIP=m
CONFIG_IEEE80211_SOFTMAC=m
CONFIG_FW_LOADER=y
CONFIG_BCM43XX=m
CONFIG_BCM43XX_DEBUG=y
CONFIG_BCM43XX_DMA=y
CONFIG_BCM43XX_PIO=y
CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
Adding bcm43xx to the blacklist and then manually loading/unloading it with the hooks in /etc/conf.d/net provides a limited degree of power savings.
# grep bcm43xx /etc/modprobe.d/blacklist
bcm43xx
/etc/conf.d/net
preup() {
if [[ $IFACE == eth1 ]]; then
# modprobe ndiswrapper
modprobe bcm43xx
/sbin/ifconfig eth1 up
sleep 1
fi
return 0
}
To use this driver, the firmware must be extracted from the older Windows 2000/XP drivers with the tool bcm43xx-fwcutter, and placed into the directory /lib/firmware. The driver install image that provided best results for my 4311 chip was:
cfd90e3f21657160405439a73ef15062 bcm4311_3.40.100.0.zip
The file containing the firmware is bcmwl5.sys. Windows identifies the file's properties as version 3.40.100.0. Only this driver version was found to contain firmware that work exceptionally well with the native linux driver.
431195b941dff794f23c2077fcbf8377 bcmwl5.sys
Using bcm43xx-fwcutter, the resulting firmware files were as such:
# /bin/ls -F -l /lib/firmware/
total 79
-rw-r----- 1 root root 3464 2007-05-05 15:20 bcm43xx_initval01.fw
-rw-r----- 1 root root 0 2007-05-05 15:20 bcm43xx_initval02.fw
-rw-r----- 1 root root 3464 2007-05-05 15:20 bcm43xx_initval03.fw
-rw-r----- 1 root root 0 2007-05-05 15:20 bcm43xx_initval04.fw
-rw-r----- 1 root root 2416 2007-05-05 15:20 bcm43xx_initval05.fw
-rw-r----- 1 root root 248 2007-05-05 15:20 bcm43xx_initval06.fw
-rw-r----- 1 root root 2416 2007-05-05 15:20 bcm43xx_initval07.fw
-rw-r----- 1 root root 2416 2007-05-05 15:20 bcm43xx_initval08.fw
-rw-r----- 1 root root 248 2007-05-05 15:20 bcm43xx_initval09.fw
-rw-r----- 1 root root 248 2007-05-05 15:20 bcm43xx_initval10.fw
-rw-r----- 1 root root 16368 2007-05-05 15:20 bcm43xx_microcode2.fw
-rw-r----- 1 root root 18416 2007-05-05 15:20 bcm43xx_microcode4.fw
-rw-r----- 1 root root 21088 2007-05-05 15:20 bcm43xx_microcode5.fw
-rw-r----- 1 root root 1144 2007-05-05 15:20 bcm43xx_pcm4.fw
-rw-r----- 1 root root 1144 2007-05-05 15:20 bcm43xx_pcm5.fw
The card manages fine, just like any other card, with baselayout-1.12.3-r9. Typically it is necessary to manually reduce to the rate to 24M or lower on 802.11g networks for the card to not drop-out. This could be added as another initialization hook, and run manually. Sometimes the driver is intelligent enough to auto-adjust the rate, and appears that it may do so starting with kernel 2.6.22.
# iwconfig eth1 rate 24M
Another driver approach would be to use net-wireless/ndiswrapper with the official Dell driver. This aproach works with baselayout also, but is not as predictable in behavior. It is the only working method for kernel versions prior to 2.6.21. The Windows driver wrapped by nidswrapper does not co-operates at all with the Dell wifi enable/disable BIOS key (Fn-F2). Disabling the wifi via the key press and then enabling should cause the wifi to stop working correctly until a reboot.
ee6033aabe3fc8f1a3325503996adb77 R151517.EXE
This file may be extracted by simply unzip'ing it.
# unzip R151517.EXE
The file containing the firmware is bcmwl5.sys. Windows identifies the file's properties as version 4.100.15.5.
b89bcf0a25aeb3b47030ac83287f894a DRIVER/bcmwl5.sys
Finally, under certain very rare cases, the wifi card may actually stop working indefinitely regardless of reboot and power off. Some how, a rare CPU hot-plugging condition plus playing with different bcmwl5.sys / bcm43xx driver versions caused the wifi card to freeze-up and never enable the internal controller again. This was fixed by entering the BIOS setup and toggling the Virtualization support to opposite of the current value. (If on, disable; if off, enable.) This causes the motherboard to perform a special BIOS and firmware reinit that by coincidence will restore the wifi card if it has locked up.
The software modem model specified by the Dell web site and the Dell BIOS setup menu is: Conexant / Intel D110 HDA MDC v.92 modem. Several on-line documents suggest using the snd-intel8x0m in combination with slamr from net-dialup/slmodem compiled with ALSA support; but this does not appear to work (unsurprisingly, since the audio driver for this chipset is not the corresponding snd-intel8x0).
# zgrep '^CONFIG_SND.*INTEL' /proc/config.gz
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_INTEL8X0=m
CONFIG_SND_INTEL8X0M=m
Non-free Conexant modem drivers for Linux are available from the Linuxant web site for this HDA HSF modem. The drivers properly detect the hardware after configure and reboot. The drivers are also in portage as net-dialup/hsfmodem. Configuration works best by stopping the alsasound service first.
/etc/modules.d/hsf
alias /dev/ttySHSF[0-9]* /dev/ttySHSF
alias /dev/modem /dev/ttySHSF
alias char-major-240 /dev/ttySHSF
alias /dev/cuaHSF[0-9]* /dev/ttySHSF
alias char-major-241 /dev/ttySHSF
options hsfserial serialmajor=240 calloutmajor=241
alias char-major-242 hsfosspec
alias /dev/hsfdiag hsfosspec
alias /dev/hsfdiag* /dev/hsfdiag
alias char-major-243 /dev/hsfdiag
options hsfosspec dcpmajor=242 diagmajor=243
probeall /dev/ttySHSF hsfpcibasic2 hsfmc97ich hsfmc97via hsfmc97ali hsfmc97ati hsfmc97sis hsfusbcd2 snd_hda_intel
# /etc/init.d/alsasound stop
# modprobe -r snd_hda_intel
# hsfconfig --auto
The CPU temperature may be monitored via the module coretemp. The sensors are wired via the Intel i810 I2C / SMBus. This driver does not appear in the offical kernel source until 2.6.22.
# zgrep '^CONFIG_\(SENSORS\|I2C\)' /proc/config.gz
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_I801=m
CONFIG_SENSORS_EEPROM=m
CONFIG_SENSORS_CORETEMP=m
Power management is primarily facilitated by the chipset's ACPI support. The daemon sys-power/acpid is used to monitor and respond to ACPI events, such as changed AC / battery power states and pressing of the power button.
A robust configuration of kernel and system responses to ACPI events can be achieved by combining sys-power/acpid with app-laptop/laptop-mode-tools. An example configuration is supplied at: /etc/acpi/, /etc/laptop-mode/.
With Linux 2.6.18 enhanced power saving aware CPU scheduling was introduced for models with CMP and/or SMT logical processor threads. For CMP processors with non-shared cache (such as desktop Pentium D), this can simply be enabled without concern toward a performance hit by:
# echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
For CMP models with shared cache (such as Core Duo), or SMT models (such as Pentium 4 HT / Xeon), the power savings does potentially incur a slight performance hit. Using app-laptop/laptop-mode-tools to automate enable/disable of the power sensitive scheduling based on battery state, create the following scripts with executable permissions:
/etc/laptop-mode/batt-start/multi-core-powersave.sh
#!/bin/bash
function sched_powersave () {
[[ -e /sys/devices/system/cpu/sched_mc_power_savings ]] && \
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
[[ -e /sys/devices/system/cpu/sched_smt_power_savings ]] && \
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
}
sched_powersave;
/etc/laptop-mode/batt-stop/multi-core-performance.sh
#!/bin/bash
function sched_performance () {
[[ -e /sys/devices/system/cpu/sched_mc_power_savings ]] && \
echo 0 > /sys/devices/system/cpu/sched_mc_power_savings
[[ -e /sys/devices/system/cpu/sched_smt_power_savings ]] && \
echo 0 > /sys/devices/system/cpu/sched_smt_power_savings
}
sched_performance;
Of additional use is sys-power/cpufrequtils to manually configure the kernel cpufreq driver settings, or load an initial setting at boot time. Another tool, from Intel themselves, is sys-power/powertop which provides an interactive analysis of the system's current power consumption (from the kernel's perspective).
Kernel configuration options of particular concern for power management follow. Some of these are only available starting with kernel 2.6.21; or they may need 3rd-party patches.
Tickless kernel with Core 2 Duo CMP scheduling and HPET timer usage. A timer setting of 300 Hz appears the best balance of performance, stability and responsiveness. (Less is not responsive enough; timer values of 864 Hz and 1000 Hz appear to have a greater tendency to cause SMP-related bootup and suspend lockups on 2.6.21, but not on 2.6.22, reason unknown.)
# zgrep '^CONFIG.*\(TICK\|HZ\|MCORE\|SMP\|_CMP\|NR_CPUS\|SCHED_MC\|HPET\)' /proc/config.gz
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_SMP=y
CONFIG_MCORE2=y
CONFIG_X86_CMPXCHG=y
CONFIG_X86_CMPXCHG64=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_NR_CPUS=2
CONFIG_SCHED_MC=y
CONFIG_HZ_300=y
CONFIG_HZ=300
CONFIG_SUSPEND_SMP=y
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_X86_FIND_SMP_CONFIG=y
CONFIG_X86_SMP=y
CPU freqency, governors, and newer ACPI states driver.
# zgrep '^CONFIG.*\(FREQ\)' /proc/config.gz
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
CONFIG_X86_ACPI_CPUFREQ=y
ACPI processor and power support.
# zgrep '^CONFIG\(_ATA_ACPI\|_ACPI\)' /proc/config.gz
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_SLEEP_PROC_FS=y
CONFIG_ACPI_PROCFS=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_BLACKLIST_YEAR=2001
CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y
CONFIG_ACPI_CONTAINER=y
CONFIG_ATA_ACPI=y
Suspend2 software suspend/hibernate (to replace conventional swsusp). Require swap space for multiple reasons, including software suspend. Software suspend also requires support for CPU hot-plugging, and operates best with CPU Freq. loaded. (Suspend2 needs to run part of its code in Uni-processor mode.) Perhaps enabling swap prefetch (from ck patches) is better or worse for battery—depending on usage patterns. Also, USB port suspend is desirable. Scripts to use the suspend2 functionality come from: sys-power/hibernate-script. Example configuration at /etc/hibernate/.
# zgrep '^CONFIG.*\(SUSPEND\|SWAP\|HOTPLUG_CPU\)' /proc/config.gz
CONFIG_SWAP=y
CONFIG_SWAP_PREFETCH=y
CONFIG_X86_BSWAP=y
CONFIG_HOTPLUG_CPU=y
CONFIG_SOFTWARE_SUSPEND=y
CONFIG_SUSPEND2_CORE=y
CONFIG_SUSPEND2_SWAP=y
CONFIG_SUSPEND2_CRYPTO=y
CONFIG_SUSPEND2_USERUI=y
CONFIG_SUSPEND2_REPLACE_SWSUSP=y
CONFIG_SUSPEND2_DEFAULT_WAIT=25
CONFIG_SUSPEND2=y
CONFIG_SUSPEND_SMP=y
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_USB_SUSPEND=y
Recommended minimal settings for building software for highest binary optimization, with little risk of corrupt binaries. Use of -O3 can lead to some strange results. Only GCC versions 4.1 and newer are considered here.
/etc/make.conf
# simplified, only showing settings that are hardware, or system-level details
ACCEPT_KEYWORDS="x86"
CHOST="i686-pc-linux-gnu"
CFLAGS="-pipe -O2 -march=prescott -mtune=prescott -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
USE="mmx mmxext sse sse2 ssse3 smp alsa acpi -apm \
nptl nptlonly threads ithreads \
i810 v4l v4l2 vesa vga fbdev fbcon dvd cdr dvdr \
ieee1394 battery cpufreq wifi"
INPUT_DEVICES="synaptics evdev keyboard mouse"
VIDEO_CARDS="i810 vesa intel v4l fbdev dummy vga"
MAKEOPTS="-j3"
# allows the openoffice ebuild and a few others to use parallel jobs on this
# multi-processor system
WANT_MP="true"
Some example Portage configuration files: /etc/portage/.
All levels of kernel premption appear to perform well; with the exception that full forced preemption appears to possibly incur occasional boot-time and suspend lockups. The same especially appears true when using a combination of: PREEMPT, SLUB, 300 HZ, NOHZ.
# uname -a
Linux pedahzur 2.6.22-timotheus-peda1 #31 SMP Mon Jul 30 00:21:44 EDT 2007 i686 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz GenuineIntel GNU/Linux
Note that for custom CFLAGS, both the march and mtune flags should be present, even though it is redundant as march infers mtune. The purpose is that Makefiles sometimes override the march to a more generic CPU model, and then the tuning flag will maintain scheduling of the generic code in favor of the desired specific CPU. One of the few applications that has difficulty with the extra mtune flag is openoffice, for which that flag should be removed prior to compilation. For significantly older ebuilds, addition of -fno-strict-aliasing may be necessary for compilation of some code.
Some CFLAGS that should possibly not be used on a CPU in the prescott family include:
Some gcc-4* CFLAGS that could provide additional optimizations for a CPU in the prescott family include:
Use of a reiserfs or reiser4 filesystem at /var/tmp/ significantly improves emerge and ccache performance. The reiserfs performance with mount options noatime,data=writeback,notail appears to give similar throughput as reiser4 with mount options noatime. (Reiser4 not recommended for any partitions other than temporary directories, and especially not recommended on headless machines due to it potentially needing manual check/rescue more often than the more stable filesystems. XFS and EXT3 come close to the same portage performance.) How reiser4 affects battery performance is unknown, as packages like app-laptop/laptop-mode-tools do not understand how to tune the filesystem. An example filesystem scheme to significantly increase Portage and ccache performance:
# grep fast /etc/fstab
/dev/mapper/vg-temp /.fast reiserfs noatime,data=writeback,notail 0 0
/.fast/tmp /tmp bind bind 0 0
/.fast/var/tmp /var/tmp bind bind 0 0
/.fast/usr/portage /usr/portage bind bind 0 0
A few references on CFLAGS:
Below are a few example kernel configurations for the Dell Inspiron 640m with T7200 processor.
Config for Linux 2.6.22 with suspend2 + CK patches (modular) (md5) (asc)
Config for Linux 2.6.21 with Viper2 patch set plus updates (modular) (md5) (asc)
Config for Linux 2.6.21 with Viper2 patch set (non-modular) (md5) (asc)
Example modules to autoload that udev does not typically know to load.
/etc/modules.autoload.d/kernel-2.6
# CPUFREQ
acpi-cpufreq
cpufreq_userspace
cpufreq_conservative
non-fatal
msr
cpuid
# ACPI
button
thermal
battery
ac
# video
# FILE SYSTEM
fuse
# xfs
# reiser4
# reiserfs
# DRIVERS
# ndiswrapper
# bcm43xx
A few references:
As of kernel 2.6.22 with CK and Gentoo patches, a particular modular kernel setup appears to provide the maximum stability, bootup speed, and bootup / suspend2 reliability. (Otherwise, boot-up and suspend2 appear to encounter occasional initialization lockups with respect to ACPI, CPU hot-plugging, SLAB/SLUB, and the MSI PCI/PCI-E bus operation.) It requires a custom initramfs for module loading of boot devices; and this example makes use of customizing the Gentoo script genkernel-3.4.8.
Key settings for stability with video card, bootup, suspend2, and very fast bootup time:
The custom kernel with initramfs is most easily generated with genkernel-3.4.8 and modifying its default settings as follows:
/usr/share/genkernel/x86/modules_load
MODULES_SCSI="sd_mod scsi_wait_scan"
MODULES_USB="ehci-hcd uhci-hcd"
MODULES_SATA="libata ata_piix scsi_wait_scan"
MODULES_FS="xfs"
MODULES_NET="b44"
MODULES_SUSPEND2="acpi-cpufreq"
MODULES_FIREWIRE="firewire-ohci"
/usr/share/genkernel/generic/initrd.defaults
# modify last line to:
MY_HWOPTS='sata scsi fs net suspend2 usb firewire'
/etc/genkernel.conf
# key options for custom kernel
MOUNTBOOT="yes"
CLEAN="no"
SAVE_CONFIG="yes"
MAKEOPTS="-j3"
Config for Linux 2.6.22 with CK + suspend2 (very modular initramfs) (md5) (asc)
# genkernel --debuglevel=3 --menuconfig --install all
/etc/modules.autoload.d/kernel-2.6
# CPUFREQ
# acpi-cpufreq
cpufreq_userspace
cpufreq_conservative
non-fatal
msr
cpuid
# ACPI
button
# FILE SYSTEM
fuse
/boot/grub/grub.conf
# example grub menu item
# Note that the kernel parameters should NOT wrap in the actual file,
# but wrap here for more a pleasant display.
title=Gentoo
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.22 real_root=/dev/sda3 resume2=swap:/dev/sda2
combined_mode=libata libata.atapi_enabled=1
video=vesafb:nocrtc,noedid,gtf,ywrap,1024x768-32@60 CONSOLE=/dev/tty1
initrd /initramfs-genkernel-x86-2.6.22
| This page was last modified on Mon, 30 Jul 2007. © Copyright Timothy Stotts 2002, 2007. All rights reserved. | ^ top of page |