# [Solved]Dell LatitudeD520 DMA Problem (Horribly slow gentoo)

## rahulthewall

So, I compiled gentoo a week ago and basicaly managed to get everything working, including compiz fusion. However, I have discovered a weird problem. However weird it may sound, my gentoo is capable of handling only one task at a time and it is quite slow at that as well. For example, I was copying the thunderbird backup from my external to my gentoo hard drive. Though the backup was only 1.8 gb it took 18 minutes for it to copy. I was earlier using Ubuntu and it took 5 minutes to copy the backup from the hard drive to the external so I assume it should have taken the same time on gentoo as well, considering that the file system that I was using on Ubuntu is also the one I am using on gentoo - namely ext3. 

Moreover, when I am compiling a package, the system performance seems to deprecate quite significantly. While I can somewhat understand this, I find it strange that the music I am playing should start to stutter when compiling a package.  

And to cap it all, my laptop keyboard and touchpad seem to freeze quite randomly during any of the above processes. Thankfully I have a USB keyboard and mouse, and they remain unaffected by this problem. Also, my touchpad and laptop keyboard only resume normal operations when I restart my computer. 

I followed the gentoo install guide quite closely and given the fact that I paid detailed attention to the kernel modules specific to my hardware and the fact that they all seem to be working fine I would assume that the kernel was configured correctly. Nevertheless, I am posting a list of my kernel modules, my xorg.conf and my make.conf in the hope that the problem resides somewhere in these files and that someone would be kind enough to help me here.

Modules that I have loaded

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/pcbc.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/crypto_algapi.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/aes.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/sha1.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/arc4.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/blkcipher.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/cbc.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/sha256.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/cryptomgr.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/ecb.ko

/lib/modules/2.6.23-gentoo-r3/kernel/crypto/michael_mic.ko

/lib/modules/2.6.23-gentoo-r3/kernel/security/capability.ko

/lib/modules/2.6.23-gentoo-r3/kernel/security/commoncap.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/crypto/padlock-aes.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/crypto/padlock-sha.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/crypto/geode-aes.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/video/output.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/video/vgastate.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/video/vga16fb.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/firmware/dell_rbu.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/char/drm/i830.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/char/drm/drm.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/char/drm/i915.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/i2c/i2c-dev.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/i2c/busses/i2c-i801.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/scsi/scsi_wait_scan.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/media/video/compat_ioctl32.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/media/video/usbvideo/quickcam_messenger.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/media/video/usbvideo/usbvideo.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/media/video/v4l1-compat.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/media/video/videodev.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/media/video/v4l2-common.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/net/dummy.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/kvm/kvm-intel.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/kvm/kvm.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/hwmon/coretemp.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/hwmon/hwmon.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/pcmcia/pcmcia.ko

/lib/modules/2.6.23-gentoo-r3/kernel/drivers/pcmcia/pcmcia_core.ko

/lib/modules/2.6.23-gentoo-r3/kernel/sound/core/snd.ko

/lib/modules/2.6.23-gentoo-r3/kernel/sound/core/snd-page-alloc.ko

/lib/modules/2.6.23-gentoo-r3/kernel/sound/core/snd-timer.ko

/lib/modules/2.6.23-gentoo-r3/kernel/sound/core/snd-pcm.ko

/lib/modules/2.6.23-gentoo-r3/kernel/sound/pci/hda/snd-hda-intel.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/bluetooth/l2cap.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/bluetooth/bluetooth.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/mac80211/mac80211.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/mac80211/rc80211_simple.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/ieee80211/ieee80211_crypt_ccmp.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/ieee80211/softmac/ieee80211softmac.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/ieee80211/ieee80211_crypt_tkip.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/ieee80211/ieee80211_crypt_wep.ko

/lib/modules/2.6.23-gentoo-r3/kernel/net/wireless/cfg80211.ko

my xorg.conf

Section "ServerLayout"

	Identifier     "X.org Configured"

	Screen      0  "Screen0" 0 0

	InputDevice    "Mouse0" "CorePointer"

	InputDevice    "Keyboard0" "CoreKeyboard"

EndSection

Section "Files"

	RgbPath      "/usr/share/X11/rgb"

	ModulePath   "/usr/lib/xorg/modules"

	FontPath     "/usr/share/fonts/misc/"

	FontPath     "/usr/share/fonts/TTF/"

	FontPath     "/usr/share/fonts/OTF"

	FontPath     "/usr/share/fonts/Type1/"

	FontPath     "/usr/share/fonts/100dpi/"

	FontPath     "/usr/share/fonts/75dpi/"

	FontPath    "/usr/share/fonts/misc:unscaled"

   	FontPath    "/usr/share/fonts/Type1"

   	FontPath    "/usr/share/fonts/TTF"

   	FontPath    "/usr/share/fonts/corefonts"

   	FontPath    "/usr/share/fonts/freefonts"

   	FontPath    "/usr/share/fonts/sharefonts"

   	FontPath    "/usr/share/fonts/terminus"

   	FontPath    "/usr/share/fonts/ttf-bitstream-vera"

   	FontPath    "/usr/share/fonts/unifont"

   	FontPath    "/usr/share/fonts/75dpi:unscaled"

   	FontPath    "/usr/share/fonts/100dpi:unscaled"

   	FontPath    "/usr/share/fonts/artwiz"

EndSection

Section "Module"

	Load  "dri"

	Load  "xtrap"

	Load  "dbe"

	Load  "GLcore"

	Load  "glx"

	Load  "record"

	Load  "extmod"

	Load  "type1"

	Load  "freetype"

EndSection

Section "InputDevice"

	Identifier  "Keyboard0"

	Driver      "kbd"

EndSection

Section "InputDevice"

	Identifier  "Mouse0"

	Driver      "mouse"

	Option	    "Protocol" "auto"

	Option	    "Device" "/dev/input/mice"

	Option	    "ZAxisMapping" "4 5 6 7"

EndSection

Section "Monitor"

	DisplaySize   304   228	 # mm

	Identifier   "Monitor0"

	VendorName   "SEC"

	ModelName    "4650"

EndSection

Section "Device"

        ### Available Driver options are:-

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"

        ### [arg]: arg optional

        #Option     "NoAccel"            	# [<bool>]

        #Option     "SWcursor"           	# [<bool>]

        #Option     "ColorKey"           	# <i>

        #Option     "CacheLines"         	# <i>

        #Option     "Dac6Bit"            	# [<bool>]

        #Option     "DRI"                	# [<bool>]

        #Option     "NoDDC"              	# [<bool>]

        #Option     "ShowCache"          	# [<bool>]

        #Option     "XvMCSurfaces"       	# <i>

        #Option     "PageFlip"           	# [<bool>]

	Identifier  "Card0"

	Driver      "intel"

	VendorName  "Intel Corporation"

	BoardName   "Mobile 945GM/GMS/940GML Express Integrated Graphics Controller"

	BusID       "PCI:0:2:0"

	Option		"UseFBDev"		"true"

	Option 		"XAANoOffscreenPixmaps" "true"

EndSection

Section "Screen"

	Identifier "Screen0"

	Device     "Card0"

	Monitor    "Monitor0"

	SubSection "Display"

		Viewport   0 0

		Depth     1

	EndSubSection

	SubSection "Display"

		Viewport   0 0

		Depth     4

	EndSubSection

	SubSection "Display"

		Viewport   0 0

		Depth     8

	EndSubSection

	SubSection "Display"

		Viewport   0 0

		Depth     15

	EndSubSection

	SubSection "Display"

		Viewport   0 0

		Depth     16

	EndSubSection

	SubSection "Display"

		Viewport   0 0

		Depth     24

	EndSubSection

EndSection

Section "Extensions"

Option "Composite" "Enable"

EndSection

my make.conf

# These settings were set by the catalyst build script that automatically

# built this stage.

# Please consult /etc/make.conf.example for a more detailed example.

CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j3"

# This should not be changed unless you know exactly what you are doing.  You

# should probably be using a different stage, instead.

CHOST="i686-pc-linux-gnu"

GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ "

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="X aac acpi alsa apm avahi bluetooth bonobo cairo cdinstall cups dbus \

dri dvd dvdr doc examples gb gnome \

gphoto2 gpm gstreamer gtk gtk2 gtkhtml hal \

ieee1394 ipv6 java javascript joystick -kde libgda \

lm_sensors mad mozilla mp3 mpeg msn ogg opengl pcmcia pdf php png \

pulseaudio quicktime samba scanner sndfile spell svg syslog usb videos \

v4l v4l2 wifi win32codecs wxwindows xine xcomposite xinerama xml yahoo \

truetype qt-static ao audiofile bzip2 cdparanoia cdr cjk ffmpeg flac jpeg \

jpeg2k xv xvid glitz"

INPUT_DEVICES="keyboard mouse synaptics joystick"

VIDEO_CARDS="i810"

PORTDIR_OVERLAY="/usr/local/layman/xeffects"

My hardware is as follows:

DELL Latitude D520

1 GB RAM

Intel 945GM Chipset

Intel(R) CPU T2300 @ 1.66GHz

Intel Integrated sound card and video

Intel 3945 wirelessLast edited by rahulthewall on Wed Jan 02, 2008 1:17 pm; edited 2 times in total

----------

## NeddySeagoon

rahulthewall3000,

I suspect you have a hard drive throughput problem because your kernel is not set up correctly.

This wold mean you don't get the use of DMA for hard drive access. The effect is a factor of 10 slowdown.

Please post the output of 

```
haparm -iI /dev/...  (your root filesyatem)

hdparm /dev/... (your root filesystem)

lscpi
```

this will allow us to check your kernel set up.

----------

## jerrykenny

also maybe changing "makeopts" to j2 might make portage less greedy . . . . . 'though I would expect any compilation to be very processor intensive,. after all, you just want the thing to get-on-with-it.

----------

## rahulthewall

Here, I am using separate partitions for root and home, posted here is the output for my root partition (though home gives the same values  :Smile:  )

/dev/hda5:

 multcount     = 16 (on)

 IO_support    =  0 (default 16-bit)

 unmaskirq     =  0 (off)

 using_dma     =  0 (off)

 keepsettings  =  0 (off)

 readonly      =  0 (off)

 readahead     = 256 (on)

 geometry      = 16383/255/63, sectors = 23069277, start = 51391998

/dev/hda5:

 HDIO_GET_IDENTITY failed: Invalid argument

ATA device, with non-removable media

        Model Number:       Hitachi HTS541060G9SA00                 

        Serial Number:      MPBCP0XGJHWD7M

        Firmware Revision:  MB3OC60R

Standards:

        Used: ATA/ATAPI-7 T13 1532D revision 1 

        Supported: 7 6 5 4 

Configuration:

        Logical         max     current

        cylinders       16383   65535

        heads           16      1

        sectors/track   63      63

        --

        CHS current addressable sectors:    4128705

        LBA    user addressable sectors:  117210240

        LBA48  user addressable sectors:  117210240

        device size with M = 1024*1024:       57231 MBytes

        device size with M = 1000*1000:       60011 MBytes (60 GB)

Capabilities:

        LBA, IORDY(can be disabled)

        Queue depth: 32

        Standby timer values: spec'd by Vendor, no device specific minimum

        R/W multiple sector transfer: Max = 16  Current = 16

        Advanced power management level: 128 (0x80)

        Recommended acoustic management value: 128, current value: 128

        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 

             Cycle time: min=120ns recommended=120ns

        PIO: pio0 pio1 pio2 pio3 pio4 

             Cycle time: no flow control=240ns  IORDY flow control=120ns

Commands/features:

        Enabled Supported:

           *    SMART feature set

                Security Mode feature set

           *    Power Management feature set

           *    Write cache

           *    Look-ahead

           *    Host Protected Area feature set

           *    WRITE_BUFFER command

           *    READ_BUFFER command

           *    NOP cmd

           *    DOWNLOAD_MICROCODE

           *    Advanced Power Management feature set

                Power-Up In Standby feature set

           *    SET_FEATURES required to spinup after power up

                SET_MAX security extension

           *    Automatic Acoustic Management feature set

           *    48-bit Address feature set

           *    Device Configuration Overlay feature set

           *    Mandatory FLUSH_CACHE

           *    FLUSH_CACHE_EXT

           *    SMART error logging

           *    SMART self-test

           *    General Purpose Logging feature set

           *    WRITE_{DMA|MULTIPLE}_FUA_EXT

           *    SATA-I signaling speed (1.5Gb/s)

           *    Native Command Queueing (NCQ)

           *    Host-initiated interface power management

                Non-Zero buffer offsets in DMA Setup FIS

                DMA Setup Auto-Activate optimization

                Device-initiated interface power management

                In-order data delivery

           *    Software settings preservation

Security: 

        Master password revision code = 65534

                supported

        not     enabled

        not     locked

                frozen

        not     expired: security count

        not     supported: enhanced erase

        40min for SECURITY ERASE UNIT. 

Checksum: correct

----------

## djdunn

yeah your DMA's not working you either aren't running hdparm and setting it at boot or your kernels not configured correctly

----------

## avnielknight

Ditto that. With the new 2.6.23 kernel my e1505 tried changing my /dev/sda node to /dev/hda and suffered a major performance loss on the disk and cdrom until I took ATA support out of my kernel. Research your hardware and setup you kernel accordingly.

----------

## rahulthewall

Yeah, solved the problem. Here is the solution:

http://www.linuxquestions.org/questions/linux-laptop-and-handheld-25/dell-d520-dma-problem-593161/

My thanks to the guys that helped me here and "biio" on linux questions.

----------

## rahulthewall

For further reference, please use this:

https://forums.gentoo.org/viewtopic-p-4570091.html#4570091

Works better!

----------

## NeddySeagoon

rahulthewall3000,

:)

----------

## rahulthewall

 :Smile: .

Thanks!

----------

