我希望有人能给我一些提示,告诉我该去哪里找。我的 Crucial MX300 750MB 在 Windows 上的表现比在 Linux 上好得多,但我找不到原因。结果如下:
- Windows:533 MB/s最大读取速度 Crucial_CT750MX300SSD1 /dev/sdb6 的 CrystalDiskMark 8.0.0 基准测试结果
- Linux:346 MB/s最大读取速度
~$ hdparm -Ttv /dev/sdb6
/dev/sdb6:
multcount = 0 (off)
IO_support = 1 (32-bit)
readonly = 0 (off)
readahead = 256 (on)
geometry = 25665/255/63, sectors = 127432704, start = 83892224
Timing cached reads: 16474 MB in 1.99 seconds = 8269.94 MB/sec
Timing buffered disk reads: 1038 MB in 3.00 seconds = 345.86 MB/sec
~$ hdparm -V
hdparm v9.58
~$ smartctl -d ata -x /dev/sdb | grep "SATA\|Firmware"
Firmware Version: M0CR070 # <-- latest firmware
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
~$ lspci -nnk
SATA controller [0106]: Intel Corporation 6 Series/C200 Series Chipset Family 6 port Mobile SATA AHCI Controller [8086:1c03] (rev 04)
Subsystem: Lenovo ThinkPad T520 [17aa:21cf]
Kernel driver in use: ahci
Kernel modules: ahci
~$ dmesg
[ 1.917727] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 1.920398] ata2.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[ 1.920405] ata2.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[ 1.920409] ata2.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[ 1.920772] ata2.00: supports DRM functions and may not be fully accessible
[ 1.921965] ata2.00: ATA-10: Crucial_CT750MX300SSD1, M0CR070, max UDMA/133
[ 1.921971] ata2.00: 1465149168 sectors, multi 16: LBA48 NCQ (depth 32), AA
[ 1.926973] ata2.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
[ 1.926980] ata2.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[ 1.926984] ata2.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[ 1.927288] ata2.00: supports DRM functions and may not be fully accessible
[ 1.930516] ata2.00: configured for UDMA/133
[ 1.941605] ata2.00: Enabling discard_zeroes_data
~$ uname -r
5.8.0-40-generic
~$ cat /sys/block/sdb/queue/scheduler
[mq-deadline] none
使用 hdparm 测量同一磁盘的速度为 485 MB/秒这里:
lptp [ ~ ]: sudo hdparm -Tt /dev/sda /dev/sda: Timing cached reads: 12388 MB in 2.00 seconds = 6197.19 MB/sec Timing buffered disk reads: 1454 MB in 3.00 seconds = 484.59 MB/sec
因此,这似乎与 hdparm 无法与 CrystalDiskMark 相提并论。我还使用最新的 Debian live iso 以及 Ubuntu 16.04.7 iso 进行了测试,并安装了 5.10.10 主线内核。hdparm 结果相同。
因此,目前可以找出以下导致性能差异的原因:
- SSD
- 电源管理
- 我的 Linux 安装
- 可能还有内核
编辑:
我找到了这个旧帖在我的电脑上,同一个磁盘在 Linux 和同一台笔记本电脑上的表现要好得多……我不知道这是怎么回事……我刚刚在 Windows 上使用同一个程序测试了 SSD,结果和以前一样!
编辑 2:更新了 BIOS。没有变化。
编辑3:在 Ubuntu 16.04.1 的 live iso 上,hdparm 测量不同的值!
ubuntu@ubuntu:~$ sudo hdparm -Tt /dev/sdb
/dev/sdb:
Timing cached reads: 15580 MB in 2.00 seconds = 7795.60 MB/sec
Timing buffered disk reads: 1308 MB in 3.00 seconds = 435.76 MB/sec
ubuntu@ubuntu:~$ hdparm -V
hdparm v9.48
ubuntu@ubuntu:~$ uname -r
4.4.0-31-generic
ubuntu@ubuntu:~$ lsb_release -d
Description: Ubuntu 16.04.1 LTS
编辑4:这是内核!!
ubuntu@ubuntu:~$ uname -r
4.9.253-0409253-generic
ubuntu@ubuntu:~$ sudo hdparm -Ttv /dev/sdb
[...]
Timing buffered disk reads: 1302 MB in 3.00 seconds = 433.43 MB/sec
ubuntu@ubuntu:~$ uname -r
4.10.0-041000rc1-generic
ubuntu@ubuntu:~$ sudo hdparm -Ttv /dev/sdb
[...]
Timing buffered disk reads: 1028 MB in 3.01 seconds = 342.02 MB/sec
测试系统中的其他一切都保持不变。如果这是一个内核错误,那么它从 4.10 开始就存在了。我会在 bugzilla 上提交报告,希望有人能花时间处理它。