# Harddrive usage kills the processor

## Dheath

I have Gentoo 32-bit installed on my machine. I think it is one or two years old now. So, it should still do fine.

Everything works smoothly except if there is a task that reads or writes a lot of data from/for hd. That means like cp, mv, tar, mkisofs etc. with big files. I think the writing part it is worse than reading.

Those actions take some time and at the same time pdflush, kblockd/0 or ksoftirqd/0 uses like ~110% of processor capacity. Even mouse cursor starts to freeze heavily.

I think this has something to do with drivers.

I have collected this information on other forum:

```

 # dmesg | grep ide

 Kernel command line: root=/dev/hdc3 vga=0x317 video=vesafb:ywrap,mtrr:2 fbcon=scrollback:128K

 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

 Probing IDE interface ide0...

 Probing IDE interface ide1...

 ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

 ide1 at 0x170-0x177,0x376 on irq 15

 # hdparm -i /dev/hdb | grep dma

 DMA modes: mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 udma3 udma4 *udma5

 # hdparm -i /dev/hdc | grep dma

 DMA modes: mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 udma3 udma4 udma5 *udma6 

# hdparm -tT /dev/hdc

/dev/hdc:

Timing cached reads: 1128 MB in 2.00 seconds = 563.27 MB/sec

Timing buffered disk reads: 10 MB in 3.42 seconds = 2.92 MB/sec

# hdparm -tT /dev/hdb

/dev/hdb:

Timing cached reads: 1124 MB in 2.00 seconds = 561.67 MB/sec

Timing buffered disk reads: 10 MB in 3.41 seconds = 2.93 MB/sec

```

Don't know if that helps though. Ask for some relevant information because I have no idea what might help solving this.

All my hard drives are Seagate.

I just like to hear any idea what might be wrong or how to get this go more smoothly.

----------

## krinn

 *Dheath wrote:*   

> 
> 
> Timing buffered disk reads: 10 MB in 3.42 seconds = 2.92 MB/sec
> 
> Timing buffered disk reads: 10 MB in 3.41 seconds = 2.93 MB/sec
> ...

 

you have really a problem with your driver, you should have a higher values there.

go there http://kmuto.jp/debian/hcl/index.cgi and check what IDE driver you need for your computer. or output your lspci | grep IDE if your lost.

----------

## Dheath

 *krinn wrote:*   

> 
> 
> you have really a problem with your driver, you should have a higher values there.
> 
> go there http://kmuto.jp/debian/hcl/index.cgi and check what IDE driver you need for your computer. or output your lspci | grep IDE if your lost.

 

```

# lspci | grep IDE

00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

 # lspci -n

00:00.0 0600: 1106:3188 (rev 01)

00:01.0 0604: 1106:b188

00:08.0 0401: 1412:1712 (rev 02)

00:0b.0 0200: 10ec:8169 (rev 10)

00:0f.0 0104: 1106:3149 (rev 80)

00:0f.1 0101: 1106:0571 (rev 06)

00:10.0 0c03: 1106:3038 (rev 81)

00:10.1 0c03: 1106:3038 (rev 81)

00:10.2 0c03: 1106:3038 (rev 81)

00:10.3 0c03: 1106:3038 (rev 81)

00:10.4 0c03: 1106:3104 (rev 86)

00:11.0 0601: 1106:3227

00:11.5 0401: 1106:3059 (rev 60)

00:18.0 0600: 1022:1100

00:18.1 0600: 1022:1101

00:18.2 0600: 1022:1102

00:18.3 0600: 1022:1103

01:00.0 0300: 10de:0045 (rev a1)

```

I know how to use the software but I have no idea about hardware. So, I think I still need a little help for this...

Btw. on the other forum they only could think that this problem might have something to do with DMA. Now that I looked the kernel settings (Device Drivers  ---> DMA Engine support  --->) "Support for DMA engines" is turned off. Might this be the problem?

----------

## bLUEbYTE84

No no, the DMA engine stuff is irrelevant.

Paste the menuconfig screen of IDE/DMA configuration part. The page with the chipset choices. Just post the part above the list of chipset choices. It is likely that you don't have an essential thing enabled there.

----------

## Dheath

 *bLUEbYTE84 wrote:*   

> No no, the DMA engine stuff is irrelevant.
> 
> Paste the menuconfig screen of IDE/DMA configuration part. The page with the chipset choices. Just post the part above the list of chipset choices. It is likely that you don't have an essential thing enabled there.

 

I'm sorry but I don't know what you mean exactly, so:

http://img152.imageshack.us/img152/1281/screenshot2007040800542pk7.png

http://img366.imageshack.us/img366/6461/screenshot2007040800545jm8.png

http://img366.imageshack.us/img366/9199/screenshot2007040800553mv1.png

http://img366.imageshack.us/img366/6052/screenshot2007040800560vj6.png

http://img366.imageshack.us/img366/9103/screenshot2007040800561ph8.png

http://img176.imageshack.us/img176/4284/screenshot2007040800570ke6.png

http://img452.imageshack.us/img452/4249/screenshot2007040800580hy1.png

http://img176.imageshack.us/img176/8541/screenshot2007040800583lq3.png

I hope some of those is right.

----------

## bLUEbYTE84

I'm assuming your drive is IDE, not SATA.

Okay, we are only interested in two places, first, Say N to 'ATA device Support' here:

http://img366.imageshack.us/img366/6052/screenshot2007040800560vj6.png

All of them should be gone here.

Next,

Go here

http://img152.imageshack.us/img152/1281/screenshot2007040800542pk7.png

First, ensure that te chipset that is selected here is correct. In this picture it is 'AMD and NVidia IDE Support'. Ensure that your your motherboard indeed has an AMD or NVidia IDE controller (southbridge). Lookup your motherboard specs if needed.

Then try:

Disable: use multi-mode by default

Enable: Sharing PCI IDE interrupts

Leave anything else that I didn't mention unchanged.

----------

## krinn

you need these drivers for your board :

- VIA VT6420 SATA RAID Controller	module: sata_via

- VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE	 module: via82cxxx

As it's vital to boot, don't compile them as module, but i just put the modules names you need so you can find them.

If i'm not wrong (witch i could), these should be SATA_VIA & PATA_VIA (in a kernel 2.6.20)

once configure your kernel should have them set and you should see that

```
cat /usr/src/linux/.config | grep ATA_VIA

CONFIG_SATA_VIA=y

CONFIG_PATA_VIA=y

```

----------

## Dheath

 *bLUEbYTE84 wrote:*   

> I'm assuming your drive is IDE, not SATA.
> 
> Okay, we are only interested in two places, first, Say N to 'ATA device Support' here:
> 
> http://img366.imageshack.us/img366/6052/screenshot2007040800560vj6.png
> ...

 

This and

 *krinn wrote:*   

> you need these drivers for your board :
> 
> - VIA VT6420 SATA RAID Controller	module: sata_via
> 
> - VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE	 module: via82cxxx
> ...

 

go against each other...

I think it is better have more options than less because I still have a lot to learn from kernel configuration.Last edited by Dheath on Sun Apr 08, 2007 1:21 pm; edited 3 times in total

----------

## bLUEbYTE84

The two (libata and ordinary ide) conflict each other for SATA.

 *Quote:*   

> I think it is better have more options than less because I still have a lot to learn from kernel configuration.

 

 :Smile: 

Then I guess it is better to both enable OSS and ALSA, for example   :Rolling Eyes:  . Good luck.

----------

## Dheath

 *bLUEbYTE84 wrote:*   

> The two (libata and ordinary ide) conflict each other for SATA.
> 
>  *Quote:*   I think it is better have more options than less because I still have a lot to learn from kernel configuration. 
> 
> Then I guess it is better to both enable OSS and ALSA, for example   . Good luck.

 

I know ALSA and OSS but I don't know about those two.

I'll move my slow edit:

This computer was not bought piece by piece unfortunately. So, there was little or not at all information what it contains.

In http://kmuto.jp/debian/hcl/index.cgi it says

 *Quote:*   

> VIA Technologies, Inc.	VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE	via82cxxx
> 
> 

 

"AMD and nVidia IDE support" could be right but in the same page (http://img366.imageshack.us/img366/6461/screenshot2007040800545jm8.png) there is "VIA82CXXX chipset support" which might be right one too. As you can see there is also "Intel PIIXn chipsets support" selected. Should I take it out?

----------

## krinn

Dheath: i just gave you information that was guess based on lspci. and as i said, i could be wrong... (but this is what i would have try if i was you)

----------

## Dheath

 *krinn wrote:*   

> Dheath: i just gave you information that was guess based on lspci. and as i said, i could be wrong... (but this is what i would have try if i was you)

 

No problem. I try and see which works better.

----------

## Dheath

Now the results are a little better 

```
# hdparm -tT /dev/hdc

/dev/hdc:

Timing cached reads:   1152 MB in  2.00 seconds = 576.04 MB/sec

Timing buffered disk reads:  162 MB in  3.01 seconds =  53.88 MB/sec

```

but are they alright? At least it seems that big files really move faster than before.

I did exactly what bLUEbYTE84 said. When I tried krinns advice with a little improvisation kernel didn't even boot.

The right chipset was "VIA82CXXX chipset support" and I took "Intel PIIXn chipsets support" and "AMD and nVidia IDE support" out of kernel.

Still thanks for both of you! I really appreciated your help  :Wink: 

----------

## CrazyPunk

Those disk stats look nice  :Very Happy: 

I switched to Kubuntu half a year ago, been using it eversince altough I do keep Win2000 installed just to be able to work with map editors and play a game if wine doesn't handle it well enough.

So I felt that I had learnt enough about linux to move onto the next big thing...Gentoo. I downloaded the netinstall cd since I wanted to build the system from the ground up. I managed to compile a working kernel and altough I made some small mistakes like grepping to /etc/fstab instead of mtab and forgetting to install the dhcp client I got everything working in four hours.

Then I emerged the X system and while emerge was rattling away I decided to copy back my home files from the backup disk.

But...as soon as I started the process, it made everything freeze every now and then and some way the compile processes didn't seem to do much at all...a look at top revealed that it was pdflush and kjournal eating all the cpu...I nosed around but since I am not into working with textbased browsers, I couldn't find much on this issue. I read an article on how a bandwith bottleneck could be the trouble, which could be since I have the backup disk on an ide40 (or whatever) cable and my other disks are on an ide80. I experimented with copying from partitions within the same disk, on the same partition, between the two ide80-cabled disks...everything gave the same result: high cpu usage by pdflush and kjournal.

By then I had X, KDe and Firefox installed again. Tests on KDE gave the same results (as expected). The situation felt grimm...I didn't want to go back to Kubuntu. It's a good os, oh yes, but it misses out on special apps like video editing software or games and became crashy and buggy after half a year of intensive use. I knew I must have made a mistake, I knew it must have been in the kernel config, so I started searching again. Google is my best friend.

I searched my ass off for this issue, and finally found this article. I am currently recompiling the kernel with some changes; it seems that I used the wrong ide drivers and I turned off the multimode support thingy as advised by BlueByte84.

Once this compile is done and I have tested the new kernel I will report if it worked or not.

----------

## CrazyPunk

Sheesh...that sucked.

I ended up doing something terribly wrong that made the kernel unbootable. It just crashed with some weird messages.

Decided to redo the whole install again. About half an hour ago my pc was finally done compiling x, kde and the vlc media player so I could continue in regular working conditions.

Configuring the new kernel properly from the start WITH the correct ide drivers did indeed solve the whole pdflush/kjournald cpu rape issue.

Also googled for "Gentoo Sucks" in lynx while the compile was still going to see if there were some issues with the system but I couldn't find anything, instead I had some very good laughs with the comments of 16 year olds who probably never used any kind of Linux or are wanking too much about small details like USE flags. As with all the pro-Gentoo comments in there, I can only agree to those. I thought Kubuntu was fast, it is faster then windows and no swaprape either (I got only 384mb on a 2ghz comp), but now that Gentoo runs with everything correctly set up...heck, it runs like a maglev train. I've learnt to look up and use USE flags, I learnt to use emerge and I really am surprised at how much more the first compiled apps already can handle...they're more complete then the standard compiled packets I encountered on Kubuntu.

Big Thumbs Up for Gentoo.

----------

