旧硬件上未启用 DMA

旧硬件上未启用 DMA

在安装了 Ubuntu 的旧硬件上工作时,我注意到使用 top 时,大量的 CPU 时间都花在等待 IO 操作上(网络数据传输正在进行中)。因此,我使用以下命令检查了 DMA 状态:

sudo hdparm -d /dev/sdb2

/dev/sdb2:
 HDIO_GET_DMA failed: Inappropriate ioctl for device

这是否意味着设备未使用 DMA?我还尝试检索有关硬件的信息,并得到了以下信息:

sudo hdparm -I /dev/sdb2

/dev/sdb2:

ATA device, with non-removable media
        Model Number:       WDC WD1600JB-00GVA0                     
        Serial Number:      WD-WCAL91665091
        Firmware Revision:  08.02D08
Standards:
        Supported: 6 5 4 
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       4092    65535
        heads           16      1
        sectors/track   63      63
        --
        CHS current addressable sectors:    4128705
        LBA    user addressable sectors:   66055248
        LBA48  user addressable sectors:  312581808
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:      152627 MBytes
        device size with M = 1000*1000:      160041 MBytes (160 GB)
        cache/buffer size  = 8192 KBytes (type=DualPortCache)
Capabilities:
        LBA, IORDY(can be disabled)
        Standby timer values: spec'd by Standard, with device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 16
        Recommended acoustic management value: 128, current value: 254
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    DOWNLOAD_MICROCODE
                SET_MAX security extension
                Automatic Acoustic Management feature set
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    SMART Command Transport (SCT) feature set
           *    SCT Long Sector Access (AC1)
           *    SCT LBA Segment Access (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
Security: 
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
        not     supported: enhanced erase
HW reset results:
        CBLID- above Vih
        Device num = 1 determined by the jumper
Checksum: correct

我从中理解应该支持 DMA。为什么我会收到该错误?当两个网络传输正在运行时,top 显示“iowait”操作的值高于 90% 是否不正常?

答案1

我在两台完全不同的计算机上分别安装了 10.04 和 12.04 时收到与您相同的消息。添加 making-d -d1表示正在将其打开,但我怀疑消息告诉我们它实际上并没有效果。

但我获得了良好的磁盘访问权限。

我曾经遇到过磁盘响应缓慢的问题,如果我没记错的话,那是因为 DMA 无法正常工作。原因是带状电缆损坏,操作次数过多,导致用于 DMA 的控制导线断裂。更换带状电缆可以大大提高性能。

就我而言,我在启动时看到了一条警告消息,更换电缆后该消息就消失了。我建议您查看 /var/log/syslog 中是否有关于磁盘适配器或驱动器的可疑消息。

相关内容