Subject: hlt in idle loop slowing down IDE
To: None <port-i386@netbsd.org>
From: Witold J. Wnuk <witek@wnuk.eu.org>
List: port-i386
Date: 05/23/2002 18:00:07
Hello,

The system:
Duron 750, VIA KT133A mb (ECS K7VZA),
40GB Seagate Barracuda IV hard disk drive
NetBSD-current

I couldn't get more than 16MB/s throughput.

Eliminating hlt in idle loop helped:

--- CUT ---
tamjee: {4} dd if=/dev/rwd0d of=/dev/null bs=64k count=4096
4096+0 records in
4096+0 records out
268435456 bytes transferred in 16.963 secs (15824763 bytes/sec)
tamjee: {5} Stopped at          cpu_Debugger+0x4:         leave
db> x/i idle+1a
idle+0x1a:                hlt
db> w/b idle+1a 90
idle+0x1a                                     0xf4 =         0x90
db> x/i idle+1a
idle+0x1a:                nop
db> c

tamjee: {5} dd if=/dev/rwd0d of=/dev/null bs=64k count=4096
4096+0 records in
4096+0 records out
268435456 bytes transferred in 6.553 secs (40963750 bytes/sec)
--- CUT ---

When hlt is used individual read() calls take quite random times (95% of them 
is spread between 2200ns and 8500ns). Without hlt times are more regular - 
70% between 1100ns and 1300ns and the rest below 3000ns.


Does anyone have an idea why waking from Halt state would be so slow? Or 
could the problem lie elsewhere?

Can anyone repeat it? (another way to experience speedup is running 
cpu-consuming task at low priority in background) Is it repeatable with other 
processors? other chipsets? other mainboards? other disks?



Greetings,

	Witold J. Wnuk



PS: I did quick search on the net and the most relevant information I found 
was FAQ on VCool (processor cooling program for Windows) homepage. It 
describes bit 7 of register 0x52 on northbridge - "disconnect enable when 
STPGNT detected" that could cause problems, but it is turned off by default 
on this system. It also cites Athlon errata regarding idle state, but the bug 
could only cause crashes (which I was not experiencing).