Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250777 - 100% / high CPU usage when reading/writing both ATA and SATA disks. 80% is wa time (waiting for I/O resources). DMA is on.
Summary: 100% / high CPU usage when reading/writing both ATA and SATA disks. 80% is wa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-12 23:36 UTC by Zorzo Luca
Modified: 2008-12-17 22:53 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Additional Infos (Additional Infos,36.83 KB, text/plain)
2008-12-12 23:41 UTC, Zorzo Luca
Details
Config gentoo-sources-2.6.26-r4 (config,48.72 KB, text/plain)
2008-12-14 20:39 UTC, Zorzo Luca
Details
dmesg output after a copy (messages,58.33 KB, text/plain)
2008-12-14 20:43 UTC, Zorzo Luca
Details
Dmesg with gentoo-sources 2.6.27-r5 and pata_via instead of older ide driver (Dmesg.Pata_Via,48.15 KB, text/plain)
2008-12-15 17:30 UTC, Zorzo Luca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zorzo Luca 2008-12-12 23:36:54 UTC
I've very high cpu usage when i use my hard-disks,for example when i copy files, load programs, burn cds/dvds, more or less everything.
This is a big problem especially when i burn cds, because software buffer loads correctly the first seconds, then it goes to 0% whit a lot of troubles.
The strange thing is that there is a good speed coping from one hd to another, but i've 100% cpu anyway.
Now i'm trying gentoo-sources 2.6.27-r5, but i've troubles with every gentoo-sources that i've tried (2.6.26-r3, 2.6.26-r4, 2.6.27).
I've also fount others with  the same problem (try googling for "100% cpu kernel disk" or something like this, but there isn't any solution.


Reproducible: Always

Steps to Reproduce:
For me they are:
1. Building up my gentoo system
2. Make something that uses disks

Actual Results:  
Cpu @ 100%, with 80% or over of wa.
DMA is on, Hds are running at their best speed, system is good configures.
There is no hang or freeze of the system, but transfer speed slow down very quickly.


Expected Results:  
I think that wa should be near 0%.
Comment 1 Zorzo Luca 2008-12-12 23:41:32 UTC
Created attachment 175155 [details]
Additional Infos
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2008-12-14 15:03:20 UTC
Do you encounter this problem for the first time? Only with this kernel?
Comment 3 Markos Chandras (RETIRED) gentoo-dev 2008-12-14 15:48:01 UTC
Oops sorry you already provided that info. Could you please attach your .config file plus the dmesg output ( especially when you are doing I/O with your disks )
Comment 4 Zorzo Luca 2008-12-14 20:39:47 UTC
Created attachment 175279 [details]
Config gentoo-sources-2.6.26-r4

Of course. Here there are my config and my dmesg after coping a 4.5 Gb file from sda4 to md2. As you can see there is not any error message.

P.S.:
Sometime it also happens that i can't burn dvds at all: sr0 or sr1 writes only lead-in and then cpu goes 100% with 45/50% wa. If this happens i can't reboot my pc anymore, and i think it is because scsi_eh_0 has 20% of sys (normally it has 0%) and it doesn't want to die .
This is a separated problem, that also happened in past (even when everything was ok), i don't know why. Maybe it can help anyway.
Comment 5 Zorzo Luca 2008-12-14 20:43:26 UTC
Created attachment 175280 [details]
dmesg output after a copy
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2008-12-14 23:41:43 UTC
Thanks for that

It seems that you are having a conflit with IDE drivers. You are using both old and new one

Here is the part im talking about

CONFIG_HAVE_IDE=y
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y

Try to disable them 

Another way to do that is using make menuconfig to go Device Drivers -> And disable ATA/ATAPI/MFM/RLL support

***WATCH OUT***

After doing this your IDE drives will appear as sdX and NOT hdx. Make sure to alter your /etc/fstab plus the lvm support and anything else that might affect this change
Comment 7 Zorzo Luca 2008-12-15 06:20:09 UTC
I think is not a real conflict, because sata hds and pata drives use libata and new drivers, and my fake raid controller Via VT6410 uses the old ide driver.
I've done this in this way because vt6410 with libata goes very slowly, 25/30Mbs against 70/75Mbs of old ide driver.
I can also say that with kernel 2.6.25-r7 (if i'm not wrong) and others 2.5.25-r* i used to have both drivers, and everything was ok.
It is also true that with this kernel there was only 3 disks and not any software raid or lvm.
Anyway i try again with new drivers, hoping that kernel will recognize automatically all my raids and lvms.
Comment 8 Markos Chandras (RETIRED) gentoo-dev 2008-12-15 08:11:14 UTC
I am not a kernel specialist but as far as I am concerned ,having two disk drivers at the same time is not that good.Since you are saying the 2.6.25-X worked ok could you please post that .config file too to identify the differences between them
Comment 9 Zorzo Luca 2008-12-15 17:30:02 UTC
Created attachment 175353 [details]
Dmesg with gentoo-sources 2.6.27-r5 and pata_via instead of older ide driver

I've attached this file that is generated with a gentoo-sources-2.6.27-r5 based kernel, configured without old ide drivers but with the new pata_via.
Kernel automatically detects software raids and lvms, but i've the same 100% cpu problem, and also this old one: http://bugs.gentoo.org/show_bug.cgi?id=235203 .
This bug was opened by me and limits hd's speed at 30Mbs.
You can find my old .config (except the old via drivers) in that bug.
So drivers doesn't conflict each other, problem must be something else.
Comment 10 Axel Dyks 2008-12-15 17:48:33 UTC
Just an idea ...
Is it possible to affect controllers separately when doing your copy test, e. g.

  dd if=/dev/zero bs=1M count=1024 of=file-on-disks-attached-to-intel

  dd if=/dev/zero bs=1M count=1024 of=file-on-disks-attached-to-via

Also, when "wait states" go up. Is there something interesting in dmesg which
you could attach to this bug?
Comment 11 Zorzo Luca 2008-12-15 18:23:50 UTC
The only problem is when i use new pata_via instead of old VIA_IDE, and in dmesg i have that:

[    1.694213] scsi4 : pata_via
[    1.694344] scsi5 : pata_via
[    1.694444] ata5: PATA max UDMA/133 cmd 0x9400 ctl 0x9800 bmdma 0xa400 irq 22
[    1.694448] ata6: PATA max UDMA/133 cmd 0x9c00 ctl 0xa000 bmdma 0xa408 irq 22
[    1.892042] ata5.00: ATA-7: ST3320620A, 3.AAF, max UDMA/100
[    1.892045] ata5.00: 625142448 sectors, multi 16: LBA48 
[    1.892056] ata5.00: limited to UDMA/33 due to 40-wire cable
[    1.966999] ata5.00: configured for UDMA/33
[    2.162225] ata6.00: ATA-7: ST3320620A, 3.AAF, max UDMA/100
[    2.162228] ata6.00: 625142448 sectors, multi 16: LBA48 
[    2.162238] ata6.00: limited to UDMA/33 due to 40-wire cable
[    2.237103] ata6.00: configured for UDMA/33

This limits my speed, nothing else because i also have the 100%cpu problem.

I've tried "dd if=/dev/zero bs=1M count=1024 of=xxx" for each of my disks and every time i have the same problem, raid or non raid, lvm or not, intel or via, old or new driver.

P.s.: Now i'm with kernel 2.6.25-r9 (r7 doesn't exist anymore), using my old 2.6.25-r7 config. Cpu problem is still here.

There is another thing: writing on ext3 partitions give me more than 80% of wa and 100% cpu overall; writing ntfs partitions give me 20% sys, 20 % usr and 0% wa, but it writes at half speed.
With win everything works ok, the only problem is that i don't like it....
Comment 12 Zorzo Luca 2008-12-15 19:24:49 UTC
I've tried Sabayon 3.5.1 live dvd and it works good.
The only problem i have is because this live dvd uses new libata (so i've 30Mbs speed). But there isn't any problem about cpu and waiting time.
And now i'm in a panic, not a kernel one, a panic of mine..
Isn't cpu waiting time a problem of kernel?! I was sure about that...
But now i'm not anymore. Could it be a software problem? Something like hal or dbus?
Into live dvd i didn't mount any partition, because if there are problems they come out also if i try a "hdparm -tT /dev/sdx" that doesn't depend on file-system or partitions.
I'll try to install sabayon, only for testing what makes it working well, i hope i can find something usefull. It's hard working out of my gentoo box ;)
Comment 13 Axel Dyks 2008-12-15 19:57:05 UTC
(In reply to comment #12)
Well it's always a good idea to use a minimal config/setup when
tracking down problems.

* Stop all services that are not needed, shutdown X, etc.
* Create a new kernel from scratch
* Sometimes it might even make sense to unplug part of the hardware. 

It's generally bad, if the cpu "actively waits" on something to happen.
Comment 14 Erik Benada 2008-12-15 22:02:55 UTC
(In reply to comment #11)
> 
> [    1.892042] ata5.00: ATA-7: ST3320620A, 3.AAF, max UDMA/100
> [    1.892045] ata5.00: 625142448 sectors, multi 16: LBA48 
> [    1.892056] ata5.00: limited to UDMA/33 due to 40-wire cable
> [    1.966999] ata5.00: configured for UDMA/33
> [    2.162225] ata6.00: ATA-7: ST3320620A, 3.AAF, max UDMA/100
> [    2.162228] ata6.00: 625142448 sectors, multi 16: LBA48 
> [    2.162238] ata6.00: limited to UDMA/33 due to 40-wire cable
> [    2.237103] ata6.00: configured for UDMA/33
> 

It looks like driver (?) is not correctly detecting 80-wire cable (assuming you have one) and therefore instead of UDMA/100 you have only UDMA/33.
Comment 15 Axel Dyks 2008-12-15 22:08:40 UTC
(In reply to comment #14)
> It looks like driver (?) is not correctly detecting 80-wire cable (assuming you
> have one) and therefore instead of UDMA/100 you have only UDMA/33.
Nope, with his original choice of using the VIA_IDE driver this hadn't been
a problem. Though it's still strange that SATA_VIA (libata) doesn't detect
cables properly ...

What actually irritates are those high values of "cpu wait states"
whenever something is copied ...
Comment 16 Markos Chandras (RETIRED) gentoo-dev 2008-12-16 10:25:27 UTC
There was a kernel bug in the past

http://bugzilla.kernel.org/show_bug.cgi?id=8142

Appears fixed however

You ( we ) might want to take a look there


The errors appear the same
Comment 17 Markos Chandras (RETIRED) gentoo-dev 2008-12-16 14:43:40 UTC
The wrong cable detection issue is a completely different bug than this one. Please consider filling a new bug about the cables issue

Thanks :)
Comment 18 archibald haddock 2008-12-16 16:52:30 UTC
It is another bug, but maybe there is a connection.
The kernel syas, that he is not detecting things right with one special driver. Maybe he is not detecting things right with one other driver, but just do not say it to the world.

Did you ever check the cables?
Comment 19 Zorzo Luca 2008-12-17 19:17:03 UTC
I apologize to everyone for having stolen you precious time.
I resolved the problem, it was because i've two cd/dvd writer, and one of them was without jumper.
System recognize it as master, win xp treat it like real master, but for gentoo, that probably overwork my hardware (this is what i want ;) it is not the same.
Now the jumper-missing drive is slave, the other one is master and everything is working properly.
Wa reaches 45% max, burning doesn't give me trouble and as far as i know i also don't have scsi_eh0 problem anymore.
So it's an hardware thing, not a kernel one.

"limited to UDMA/33 due to 40-wire cable, configured for UDMA/33" is still here if i use libata-based drivers: this is for sure a kernel bug.
I don't know if i can continue this "not real" bug or reopen my old one.

Thanks again to everyone.
Comment 20 Daniel Drake (RETIRED) gentoo-dev 2008-12-17 19:49:58 UTC
I'd suggest opening a new bug for the pata_via cable detection problem. Thanks for the update.
Comment 21 Zorzo Luca 2008-12-17 22:53:34 UTC
Without reopening the bug, i've 90-99% wa when coping to a usb pen.
Is it normal?