Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VERY slow read HD performance (Timing buffered disk reads)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Lucero del Alba
n00b
n00b


Joined: 27 Sep 2003
Posts: 12
Location: Buenos Aires, Argentina

PostPosted: Sat Sep 27, 2003 6:18 am    Post subject: VERY slow read HD performance (Timing buffered disk reads) Reply with quote

Hello people, I'm a new Gentoo user and this is my first post. I would like to solve a little problem with the performance of my hard disk, perhaps you could help me.

I realized that my system gets VERY slow when performs an aggressive reading or writing to my hard disk. I couldn't find the reason for I while, but take these examples: if I watch a video from my HD the system gets slower, if a watch it from the CD-ROM the systems works normally; when burning a CD (from an ISO or whatever, from my HD) everything gets **so** irritating slow unit burning finished; when copy a big file from a partition to another... and so on. By the way, I don't have this particular problem under MS Windows.

Before Gentoo I was using SuSE 8.0 and then switched. I build it from stage1, and the system itself is now much faster than before (applications, etc), I mean, everything else works correctly but this issue. I was seeking the forum for a possible solution but didn't find it although I found 2 related posts (Slow CP speeds across HD and slow second ide device).

Alright, this is my box:
    HD: 40 GB Maxtor.
    CPU: 1 GHz AMD Duron.
    RAM: 256 MB DDR.
More info?

Code:
bash-2.05b$ dmesg | grep hda
Kernel command line: root=/dev/hda7 hdc=ide-scsi hdd=ide-scsi
    ide0: BM-DMA at 0xd400-0xd407, BIOS settings: hda:DMA, hdb:pio
hda: Maxtor 5T040H4, ATA DISK drive
hda: 80043264 sectors (40982 MB) w/2048KiB Cache, CHS=4982/255/6

And the most important:

Code:
bash-2.05b# hdparm -tT /dev/hda

/dev/hda:
 Timing buffer-cache reads:   128 MB in  0.66 seconds =195.42 MB/sec
 Timing buffered disk reads:  64 MB in 33.44 seconds =  1.91 MB/sec

As you can see, the "buffered disk reads" is extremely slow! And an except from my /etc/fstab:

Code:
/dev/hda1           /mnt/c          vfat    defaults,uid=1000,gid=100  0 0
/dev/hda2           /mnt/e          ntfs    defaults,uid=1000,gid=100  0 0
/dev/hda7           /               reiser  noatime,notail             0 1
/dev/hda6           none            swap    sw                         0 0
/dev/cdroms/cdrom0  /mnt/cdrecorder iso9660 user,noauto,ro             0 0
/dev/cdroms/cdrom1  /mnt/cdrom      iso9660 user,noauto,ro             0 0

... by the way, my boot is also on /dev/hda7 (that's way "notail" option is enabled). My only HD is alone as primary master, and my CD-RW / CD-ROM are on secondary IDE

So, that's it. Any suggestion, clue, comment... anything?

Thanks in advance, people!
_________________
Emiliano Bazaes
IRIS on MIRROR Development Director
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sat Sep 27, 2003 11:00 am    Post subject: Reply with quote

Lucero del Alba,

It looks like a serious case of not using DMA on the hard drive.

What does using_dma say at the bottom of less /proc/ide/hda/settings?
If its not a 1, read man hdparm and learn how to set it.

If dma is always safe on your chip set, turn it on in the kernel, which I think you can do with a parameter on the kerenl command line.

Regards,

NeddySeagoon
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Caffeine
Guru
Guru


Joined: 17 Jul 2002
Posts: 401
Location: Melbourne, Australia

PostPosted: Sat Sep 27, 2003 4:15 pm    Post subject: Reply with quote

Yeah, sounds like you haven't enabled DMA.

You can check it either as per NeddySeagoon's suggestion, or use hdparm so:

Code:
espresso root # hdparm -d /dev/hda

/dev/hda:
 using_dma    =  1 (on)

To enable DMA:
Code:
espresso root # hdparm -d1 /dev/hda

/dev/hda:
 setting using_dma to 1 (on)
 using_dma    =  1 (on)


There are other paramaters you can tune with hdparm also but I cann't find the thread as the search page seems to have died.
Back to top
View user's profile Send private message
Lucero del Alba
n00b
n00b


Joined: 27 Sep 2003
Posts: 12
Location: Buenos Aires, Argentina

PostPosted: Sun Sep 28, 2003 12:13 am    Post subject: solved! thank you Reply with quote

Hello again. You both were right, DMA was disabled for my first IDE.

As NeddySeagoon indicated, using_dma in /proc/ide/hda/settings was in '0', and I could enable it with hdparm, as Caffeine pointed (with "hdparm -d1 /dev/hda") and things were better immediately:

Code:
bash-2.05b# hdparm -tT /dev/hda
 
/dev/hda:
 Timing buffer-cache reads:   128 MB in  0.70 seconds =181.56 MB/sec
 Timing buffered disk reads:  64 MB in  1.84 seconds = 34.78 MB/sec

I had some troubles trying to parsing the necessary options to the kernel, at boot-time 'til I finally catched it:

Code:
ide0=ata66 ide0=dma

Firstly, this was confusing to me because my HD is an ATA100, but 'ata66' option seems to be valid to ATA 66 and ATA100 drives (ATA133??).

Thanks very much for your comments, people!!

By the way. If someone else out there had this same problem, the options "ide0=ata66 ide0=dma" (which worked to me) can be parsed to the kernel easily. If you had Grub as boot manager (my case), edit /boot/grub/grub.conf (or /boot/grub/menu.lst) and find something like "kernel (hd0,6)/boot/bzImage" and add " ide0=ata66 ide0=dma" in that same line. Then, should get something like:

Code:
title=Gentoo Linux
root (hd0,6)
kernel (hd0,6)/boot/bzImage root=/dev/hda7 ide0=ata66 ide0=dma

If you had LILO as boot-manager you should add append="ide0=ata66 ide0=dma", like this:

Code:
image=/boot/bzImage
         label=Gentoo
         (...)
         append="ide0=ata66 ide0=dma"

You need also to have enabled some flags on your kernel under "ATA/IDE/MFM/RLL support" and "IDE, ATA and ATAPI Block devices":

Code:
[*]     Generic PCI bus-master DMA support
[*]       Use PCI DMA by default when available

More info at the The Linux Ultra-DMA Mini-Howto (see Activating and Deactivating UDMA section).

See ya!
_________________
Emiliano Bazaes
IRIS on MIRROR Development Director
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum