Optimizing hard drive performance on Linux Virtual PCs

Discussion in 'Virtual PC' started by havuk, Aug 24, 2004.

  1. havuk

    havuk Guest

    hdparm is a Linux shell utility for viewing and manipulating various IDE
    drive and driver parameters. Investigation and testing of multiple Linux
    distributions has proved the following configuration to be optimal for most
    Virtual PCs:

    hdparm -m128 -u1 -c3 -W1 -A1 -d1 -X66 /dev/hda

    To test this configuration on a specific Virtual PC, the above command can
    be entered in a Linux console. This command does not make any permanent
    changes, and the hard drive settings will revert once the Virtual PC is reset.

    Once the above command has been tested, the configuration can be made
    permanent by adding the command to the top of the /etc/rc.d/rc.local startup
    script. To stop hdparm from displaying any output during the boot process,
    use the following command:

    hdparm -qm128 -qu1 -qc3 -qW1 -qA1 -qd1 -qX66 /dev/hda
     
    havuk, Aug 24, 2004
    #1
    1. Advertisements

  2. havuk

    havuk Guest

    The recommended hdparm command utilizes a number of configuration parameters.
    Below is a list of the parameters used, along with an explanation of what
    each parameter does.

    -m128 - Enables multiple sector mode (aka IDE Block Mode) and sets the block
    size to 128 sectors.
    -u1 - Permits Linux to unmask other interrupts while processing a drive
    interrupt.
    -c3 - Enables 32 bit I/O support with synchronization.
    -W1 - Enables the IDE drive's write caching feature.
    -A1 - Enables the IDE drive's read-lookahead feature.
    -d1 - Enables DMA support on the virtual hard drive.
    -X66 - Sets the IDE drive to use Ultra DMA mode2
    /dev/hda - Specifies which IDE device to apply the configuration changes to.
     
    havuk, Aug 24, 2004
    #2
    1. Advertisements

  3. havuk

    havuk Guest

    Many Linux distributions use programmed I/O (PIO) over direct memory access
    (DMA) for their default method of accessing the hard drive - as some Linux
    developers debate the advantages of PIO vs. DMA when running on physical
    hardware.

    However, in an emulated environment DMA has major advantages over PIO. PIO
    sends all hard drive requests through the CPU, so that during a typical hard
    drive operation both the CPU and the hard drive controller are heavily
    utilized. DMA, on the other hand, communicates directly to the hard drive
    controller and side steps the CPU for hard drive activity.

    Virtual PC is optimized for DMA to virtualized IDE devices (CD/DVDs and hard
    drives). PIO requires one I/O operation (IN/OUT instruction) for every two or
    four bytes read from or written to an IDE device. These I/O accesses are
    difficult to virtualize, and the overhead for each I/O
    access is relatively high. DMA, on the other hand, only requires one I/O
    operation for each multisector read or write operation.
     
    havuk, Aug 24, 2004
    #3
  4. FWIW - this is a direct copy from the old TechRef for VPC 5.2 - available on
    Steve's site:

    http://www.essjae.com/VPC/virtual_pc_downloads.htm

    --
    Cheers,
    Benjamin Armstrong
    ======================
    Virtual PC Program Manager

    This posting is provided "AS IS" with no warranties, and confers no rights.
    You assume all risk for your use.
     
    Benjamin Armstrong [MSFT], Aug 24, 2004
    #4
  5. microsoft.public.virtualpc news group, Benjamin Armstrong [MSFT]
    I knew I'd seen all of that before, just hadn't gotten the cobwebs out
    to figure out where. :)
     
    Paul Adare - MVP - Microsoft Virtual PC, Aug 24, 2004
    #5
  6. havuk

    Steve Jain Guest

    But, I cannot take credit for writing it originally, methinks it was
    Mr. Ben A.

    Steve Jain, Microsoft MVP for Virtual PC for Windows
    Website: http://www.essjae.com
    *** All posts are provided AS-IS, no warranty, no QoS ***
     
    Steve Jain, Aug 24, 2004
    #6
  7. Yeah - but I can't find any copies of the original doc online anymore :)

    --
    Cheers,
    Benjamin Armstrong
    ======================
    Virtual PC Program Manager

    This posting is provided "AS IS" with no warranties, and confers no rights.
    You assume all risk for your use.
     
    Benjamin Armstrong [MSFT], Aug 24, 2004
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.