Erodov.com Forums | India's Top Technology forum.
Loading

navigation
  • Home
  • Forums
  • Articles
  • News
  • Gaming
  • Bazaar
  • Community
  • What's New
  • My Erodov
  • Help
navigation
Go Back   Erodov.com Forums | India's Top Technology forum. > Articles > Tutorials and Guides
Register Forgot Password?
Follow Erodov on Twitter Follow Us
Join us on FaceBook Join Us
Post New Article  Comment
 
Article Tools Search this Article
Hard disk UDMA mode to PIO Mode Causing Performance Drop - Solution
Hard disk UDMA mode to PIO Mode Causing Performance Drop - Solution
Date: 19-05-08
Topic: Tutorials and Guides
Author: Jinu

Index
Home 
Hard disk UDMA mode to PIO Mode Causing Performance Drop - Solution

At the outset I would like to say that I have borrowed heavily for this article from various pages. In case you want the detailed articles please go the url listed below:

PCGuide - Ref - IDE/ATA Transfer Modes and Protocols
Microsoft Help and Support


Also to add that this is applicable for IDE and SATA drives (on Intel chipset based boards), because on Intel Chipset based board SATA controllers are shown as IDE controllers and SATA drives use UDMA. I am not sure about Nvidia Chipsets based boards.

THE BASICS:

Before we get into the problem we first need understand a little bit on data Transfer Mechanisms. There are basically 2 ways in which data is sent and received from your drives (hard disk and optical drives)

1. Programmed I/O (PIO)

The oldest method of transferring data over the IDE/ATA interface is through the use of programmed I/O. This is a technique whereby the system CPU and support hardware directly control the transfer of data between the system and the hard disk. There are several different speeds of programmed I/O, which are of course called programmed I/O modes, or more commonly, PIO modes.

PIO Mode 0 - 3.3 MB/s
PIO Mode 1 - 5.2 MB/s
PIO Mode 2 - 8.3 MB/s
PIO Mode 3 - 11.1 MB/s
PIO Mode 4 - 16.7 MB/s

Not only does PIO involve a lot of wasteful overhead, the CPU is "distracted" from its ordinary work whenever a hard disk read or write is needed. This means that the more data the system must transfer, the more the CPU gets bogged down. As hard disk transfer rates continue to increase, the load on the CPU would have continued to grow. This is the key reason why PIO modes are no longer used on new systems, having been replaced by DMA modes, and then later, Ultra DMA.

2. Direct Memory Access (DMA)


As described above PIO as a method of transferring data between the hard disk and the rest of the system has a serious flaw: it requires a fair bit of overhead, as well as the care and attention of the system's CPU. Clearly, a better solution is to take the CPU out of the picture entirely, and have the hard disk and system memory communicate directly. Direct memory access or DMA is the generic term used to refer to a transfer protocol where a peripheral device transfers information directly to or from memory, without the system processor being required to perform the transaction. DMA has been used on the PC for years over the ISA bus, for devices like sound cards and the floppy disk interface.

To cut a long story short the DMA technology advanced as follows:

Single Word DMA --> MultiWord DMA --> Ultra DMA

More details on each can be found at Direct Memory Access (DMA) Modes and Bus Mastering DMA

The key technological advance introduced to IDE/ATA in Ultra DMA was double transition clocking. Before Ultra DMA, one transfer of data occurred on each clock cycle, triggered by the rising edge of the interface clock (or "strobe"). With Ultra DMA, data is transferred on both the rising and falling edges of the clock. Double transition clocking, along with some other minor changes made to the signaling technique to improve efficiency, allowed the data throughput of the interface to be doubled for any given clock speed.

In order to improve the integrity of this now faster interface, Ultra DMA (UDMA) also introduced the use of cyclical redundancy checking or CRC on the interface. The device sending data uses the CRC algorithm to calculate redundant information from each block of data sent over the interface. This "CRC code" is sent along with the data. On the other end of the interface, the recipient of the data does the same CRC calculation and compares its result to the code the sender delivered. If there is a mismatch, this means data was corrupted somehow and the block of data is resent.

Today, the use of Ultra DMA is the standard in the industry. Transfer rates on the Ultra DMA modes are :

UDMA Mode 0 - 16.7 MB/s
UDMA Mode 1 - 25.0 MB/s
UDMA Mode 2 - 33.3 MB/s
UDMA Mode 3 - 44.4 MB/s
UDMA Mode 4 - 66.7 MB/s
UDMA Mode 5 - 100 MB/s


THE PROBLEM -

The typical symptoms seen are:
1. Major Drop in System performance
2. Increased CPU usage but this cannot be attributed to any process in Task Manager. Thought to be a virus/spyware, but scans show a clean system.
3. Occassional PC crash - again no reason

THE CAUSE:

1. The hard disk (generally the root disk containing the OS) is using the PIO mode for data transfer. As from our abouve discussion we know that hard disks should use UDMA 4 or 5 for data transfer.

THE DIAGNOSIS:

1. Use a hard disk benchmarking utility like HDTune and test the disk. The transfer rates would have fallen to 3-4 MB/s and the CPU utilization would be around 20-25%
2. To confirm the problem do the following :
- Double-click Administrative Tools, and then click Computer Management.
- Click System Tools, and then click Device Manager.
- Expand the IDE ATA/ATAPI Controllers node.
- Double-click the controller (typically Primary IDE Channel) for which you want to check.
- Here go to Advanced Settings and check the Value of Current Transfer Mode (It will be PIO)

THE REASON:

So why does the controller shift from UDMA to PIO mode on its own?

For this we have to thank Microsoft. Well windows is designed such that if the Windows IDE/ATAPI Port driver (Atapi.sys) receives a cumulative total of six time-out or cyclical redundancy check (CRC) errors, the driver reduces the communications speed (the transfer mode) from the highest Direct Memory Access (DMA) mode to lower DMA modes in steps. If the driver continues to receive time-out or CRC errors, the driver eventually reduces the transfer mode to the slowest mode (PIO mode). And the worst part is that there is not straightforward way to make it go back to UDMA mode.

WORKAROUND - How to move transfer mode from PIO back to UDMA


To re-enable the UDMA mode for an affected device:
1. Double-click Administrative Tools, and then click Computer Management.
2. Click System Tools, and then click Device Manager.
3. Expand the IDE ATA/ATAPI Controllers node.
4. Double-click the controller (typically Primary IDE Channel) for which you want to restore the typical DMA transfer mode.
5. Click the Driver tab.
6. Click Uninstall.
7. When the process completes, restart your computer. When Windows restarts, the hard disk controller is re-enumerated and the transfer mode is reset to the default value for each device that is connected to the controller.

How to ensure that this does not repeat or atleast not as frequently

Microsoft realising the problems faced by its customers provided a way by which a lesser aggresive policy is used when downgrading transfer modes.

MS provided a way to make windows take a less-aggressive policy to reduce the transfer mode (from faster to slower DMA modes, and then eventually to PIO mode) on time-out and CRC errors. The existing behavior is that the IDE/ATAPI Port driver (Atapi.sys) reduces the transfer mode after any 6 cumulative time-out or CRC errors. When the new policy is implemented by this fix, Atapi.sys reduces the transfer mode only after 6 consecutive time-out or CRC errors. This new policy is implemented only if the registry value that is described below is present.

Follow these steps, and then quit Registry Editor:
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\0001
3. On the Edit menu, point to New, and then click DWORD Value.
4. Type ResetErrorCountersOnSuccess, and then press ENTER.
5. On the Edit menu, click Modify.
6. Type 1, and then click OK.
Follow these steps, and then quit Registry Editor:
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\0002
3. On the Edit menu, point to New, and then click DWORD Value.
4. Type ResetErrorCountersOnSuccess, and then press ENTER.
5. On the Edit menu, click Modify.
6. Type 1, and then click OK.
Note The numbered subkeys that are listed earlier correspond to the primary and secondary IDE channels on a computer that contains a single IDE controller. If your computer contains two IDE controllers, the numbered subkeys for the primary and secondary IDE channels for each of the two controllers may be:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\0002

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\0003

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\0004

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\0005
To verify that you have located the correct subkey, verify that the DriverDesc value for the subkey contains the string value "Primary IDE Channel" or the string value "Secondary IDE Channel."

WARNING:

Please note that if you disk is repeatedly moving to PIO mode then there is an issue with the Hard Disk or the Disk Cable or the power Supply. Hard disks are very sensitive to Power Supply variations.. typically if you start facing Hard Disk problems and your disk is not that old then the culprit is usually the power supply. So if your disk is repeatedly moving to PIO mode.. its time to get a new disk or a new PSU or maybe a new data cable.

Hope you all found the article interesting and useful.

Index
Home 


Tools
Add to Jinu's Karma
Show Printable Version Show Printable Version
Email this Page Email this Page
  #1  
By KiD0M4N 19-05-08
Re: Hard disk UDMA mode to PIO Mode Causing Performance Drop - Solution

Nice concise collection of information. Good writeup. *Approved*
Reply With Quote
  #2  
By NashX 30-05-08
Re: Hard disk UDMA mode to PIO Mode Causing Performance Drop - Solution

How come i missed this ??very useful mate..Rep'ed
Reply With Quote
  #3  
By ibz 03-06-08
Re: Hard disk UDMA mode to PIO Mode Causing Performance Drop - Solution

ooh nice.maybe ill see why my laptop is behaving strangely
Reply With Quote
Post New Article  Comment
Please share with friends!

Article Tools Search this Article
Search this Article:

Advanced Search
Display Modes


Similar Threads
Article Article Starter Category Comments Last Post
Upgrade Msi GTX 580 in SLI MODE dr.sankhadeep Upgraditis 13 18-01-11 11:27 PM
What is PCI 2.0 (x16 mode and x4 mode) syedthedevil General Hardware and Peripherals 4 04-10-09 01:34 PM
USB working on 1.1 mode ! kaiserbreath Operating Systems 6 30-05-09 11:46 AM
2 Gfx in connected in SLI mode?? AzErTy Hardware and Case Mods 7 07-05-08 12:55 AM
Console mode in UT3 Aragorn x Gaming 1 08-12-07 08:08 PM


Tags
causing, disk, drop, hard, mode, performance, pio, solution, udma

All times are GMT +5.5. The time now is 10:26 AM.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0 PL2 ©2011, Crawlability, Inc.