====== Raspberry Pi で SD カードを 125 MHz にオーバークロック🔥💥する方法🤤 ====== ===== SD カードの転送速度は Raspberry Pi でも PC の半分ほどまでは引き上げられる🤔 安定常用可能なチューニングは 125 MHz の時代へ!!😍 ===== **KIOXIA EXCERIA 128GB/256GB microSDXC Class10 UHS-I U1 (read 100MB/s)**\\ {{:hardware:sdcard_bench_kioxia_exceria_128gb_microsdxc_class10_uhs-i_u1_001.jpg?100|KIOXIA EXCERIA 128GB microSDXC Class10 UHS-I U1}} {{:hardware:sdcard_bench_kioxia_exceria_256gb_microsdxc_class10_uhs-i_u1_001.jpg?100|KIOXIA EXCERIA 256GB microSDXC Class10 UHS-I U1}}\\ ^ [[hardware:raspberry_pi:sdcard_overclock:kioxia_exceria_128gb_microsdxc_class10_uhs-i_u1|KIOXIA EXCERIA 128GB microSDXC Class10 UHS-I U1 (read 100MB/s)]]    \\ [[hardware:raspberry_pi:sdcard_overclock:kioxia_exceria_256gb_microsdxc_class10_uhs-i_u1|KIOXIA EXCERIA 256GB microSDXC Class10 UHS-I U1 (read 100MB/s)]] New! ^^^^^^^^^^ ^ Windows CrystalDiskMark ^^^^^^^^^^ ^  SEQ1M Q8T1 ^ Read | 98.311 MB/s ^ Write | 32.031 MB/s ^ SEQ1M Q1T1 ^ Read | 97.013 MB/s ^ Write | 29.957 MB/s | ^ Raspberry Pi Benchmarks (AVG) ^^^^^^^^^^ ^ core_freq ^ turbo ^ sd clock ^^ WRITE(dd) ^^ READ(dd) ^^ HDPARM ^^ ^  CONFIG: force_turbo=1,core_freq=565,sd_overclock=125 (安定常用可能🤤) ^^^^^^^^^^ | 565 | 1 | 125.000 MHz || 15.57 MB/s || 46.89 MB/s || 47.23 MB/s || | 550 | 1 | 125.000 MHz || 15.46 MB/s || 45.62 MB/s || 45.52 MB/s || ^  CONFIG: force_turbo=1,sd_overclock=100 ^^^^^^^^^^ | 400 | 1 | 100.000 MHz || 13.58 MB/s || 41.56 MB/s || 41.15 MB/s || ^  CONFIG: default ^^^^^^^^^^ | 400 | 0 | 50.000 MHz || 12.05 MB/s || 22.09 MB/s || 21.79 MB/s || 注意!! UHS 認定されていないカードの場合、データが破損する可能性があるので、バックアップは必須です😊\\ [[windows:usb_image_tool|USB Image Tool - USB フラッシュ、SD カードのバックアップ/復元]]\\ 以下の環境でオーバークロックして検証する。\\ OS: DietPi v7.4.2, v8.7.1\\ Device model: RPi Zero W (armv6l)\\ Kernel: Linux DietPi-001 5.10.52+ #1441 Tue Aug 3 18:08:18 BST 2021 armv6l GNU/Linux\\     Linux DietPi-001 5.15.32+ #1538 Thu Mar 31 19:37:58 BST 2022 armv6l GNU/Linux\\ CrystalDiskMark でのベンチマーク結果は [[hardware:sd_memory_card|SD メモリーカード]] を参照😉\\ ===== 元にした海外の文献を整理 ===== [[tw>geerlingguy|Jeff Geerling]] 氏のブログ投稿\\ [[git>geerlingguy|geerlingguy - GitHub]] で多くのオープンソースプロジェクトの維持に貢献されているエンジニアの方です🥰\\ **2018/04/06**\\ Raspberry Pi microSD カード パフォーマンス比較 - 2018\\ [[https://www.jeffgeerling.com/blog/2018/raspberry-pi-microsd-card-performance-comparison-2018|Raspberry Pi microSD card performance comparison - 2018 | Jeff Geerling]]\\ 「Raspberry Pi microSD カード パフォーマンス比較 - 2015」人気のあるブログ投稿から 3 年間で Raspberry Pi に新しいリビジョンが増えて「Raspberry Pi 3B+ のレビューとパフォーマンスの比較」の一環として、多くの microSD カードが再ベンチマークされました😍\\ **2018/04/05**\\ Raspberry Pi 3B+ のレビューとパフォーマンスの比較\\ [[https://www.jeffgeerling.com/blog/2018/raspberry-pi-3-b-review-and-performance-comparison|Raspberry Pi 3 B+ Review and Performance Comparison | Jeff Geerling]]\\ **2016/03/16**\\ [[https://www.jeffgeerling.com/blog/2016/how-overclock-microsd-card-reader-on-raspberry-pi-3|How to overclock the microSD card reader on a Raspberry Pi 3 | Jeff Geerling]]\\ [[http://www.pidramble.com/|Pi Dramble]] は [[https://github.com/geerlingguy/raspberry-pi-dramble|GitHub - geerlingguy/raspberry-pi-dramble: Raspberry Pi Kubernetes cluster that runs HA/HP Drupal 8]] で公開されている Drupal の Raspberry Pi クラスターである🤔\\ 「Raspberry Pi microSD カード パフォーマンス比較 - 2015」ブログ投稿後に、数人の読者から UHS microSD カードの速度をさらに上げる方法が寄せられてまとめられました🤤\\ **2015/12/01**\\ Raspberry Pi microSD カード パフォーマンス比較 - 2015\\ [[https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-microsd-card|Raspberry Pi microSD card performance comparison - 2015 | Jeff Geerling]]\\ ブログ投稿の中で Raspberry Pi のパフォーマンスを向上させるための最も影響の大きいアップグレードの 1 つは、可能な限り最速の microSD カードを購入すること。ランダムな読み取りと書き込みを大量に行う必要があるアプリケーションの場合は特にそうです。 と述べられている。\\ ===== ベンチ結果まとめ ===== ^ [[hardware:raspberry_pi:sdcard_overclock:kioxia_exceria_256gb_microsdxc_class10_uhs-i_u1|KIOXIA EXCERIA 256GB microSDXC Class10 UHS-I U1 (read 100MB/s)]]\\ [[hardware:raspberry_pi:sdcard_overclock:kioxia_exceria_128gb_microsdxc_class10_uhs-i_u1|KIOXIA EXCERIA 128GB microSDXC Class10 UHS-I U1 (read 100MB/s)]] ^^^^^^^^^^ ^ Windows CrystalDiskMark ^^^^^^^^^^ ^  SEQ1M Q8T1 ^ Read | 98.311 MB/s ^ Write | 32.031 MB/s ^ SEQ1M Q1T1 ^ Read | 97.013 MB/s ^ Write | 29.957 MB/s | ^ Raspberry Pi Benchmarks (AVG) ^^^^^^^^^^ ^ core_freq ^ turbo ^ sd clock ^^ WRITE(dd) ^^ READ(dd) ^^ HDPARM ^^ ^  CONFIG: default ^^^^^^^^^^ | 400 | 0 | 50.000 MHz || 12.05 MB/s || 22.09 MB/s || 21.79 MB/s || ^  CONFIG: force_turbo=1,core_freq=565,sd_overclock=125 (安定常用可能🤤) ^^^^^^^^^^ | 565 | 1 | 125.000 MHz || 15.57 MB/s || 46.89 MB/s || 47.23 MB/s || | 550 | 1 | 125.000 MHz || 15.46 MB/s || 45.62 MB/s || 45.52 MB/s || ^  CONFIG: force_turbo=1,sd_overclock=100 ^^^^^^^^^^ | 400 | 1 | 100.000 MHz || 13.58 MB/s || 41.56 MB/s || 41.15 MB/s || ^ [[hardware:raspberry_pi:sdcard_overclock:sandisk_128gb_microsdxc_class10_uhs-i_u1_a1|SanDisk 128GB microSDXC Class10 UHS-I U1 A1 (read 120MB/s)]] ^^^^^^^^^^ ^ Windows CrystalDiskMark ^^^^^^^^^^ ^  SEQ1M Q8T1 ^ Read | 125.470 MB/s ^ Write | 36.448 MB/s ^ SEQ1M Q1T1 ^ Read | 124.919 MB/s ^ Write | 36.075 MB/s | ^ Raspberry Pi Benchmarks (AVG) ^^^^^^^^^^ ^ core_freq ^ turbo ^ sd clock ^^ WRITE(dd) ^^ READ(dd) ^^ HDPARM ^^ ^  CONFIG: default ^^^^^^^^^^ | 400 | 0 | 50.000 MHz || 16.03 MB/s || 22.09 MB/s || 21.88 MB/s || ^  CONFIG: force_turbo=1,core_freq=520,sd_overclock=104 ^^^^^^^^^^ | 520 | 1 | 104.000 MHz || 19.50 MB/s || 44.50 MB/s || 43.39 MB/s || | 500 | 1 | 100.000 MHz || 20.51 MB/s || 42.24 MB/s || 41.19 MB/s || ^  CONFIG: force_turbo=1,sd_overclock=100 ^^^^^^^^^^ | 400 | 1 | 100.000 MHz || 17.00 MB/s || 41.90 MB/s || 40.79 MB/s || ^ [[:hardware:raspberry_pi:sdcard_overclock:toshiba_exceria_32gb_microsdhc_class10_uhs-i_u3|TOSHIBA EXCERIA 32GB MicroSDHC Class10 UHS-I U3]] ^^^^^^^^^^ ^ Windows CrystalDiskMark ^^^^^^^^^^ ^  SEQ1M Q8T1 ^ Read | 97.552 MB/s ^ Write | 57.942 MB/s ^ SEQ1M Q1T1 ^ Read | 95.505 MB/s ^ Write | 59.038 MB/s | ^ Raspberry Pi Benchmarks (AVG) ^^^^^^^^^^ ^ core_freq ^ turbo ^ sd clock ^^ WRITE(dd) ^^ READ(dd) ^^ HDPARM ^^ ^  CONFIG: default ^^^^^^^^^^ | 400 | 0 | 50.000 MHz || 14.36 MB/s || 22.24 MB/s || 21.43 MB/s || ^  CONFIG: force_turbo=1,core_freq=555,sd_overclock=125\\  (core クロックを引き上げると SD bus クロックも core の乗数で引き上げられる) ^^^^^^^^^^ | 555 | 1 | 125.000 MHz || 6.89 MB/s || 47.66 MB/s || 46.31 MB/s || | 550 | 1 | 125.000 MHz || 6.78 MB/s || 47.62 MB/s || 45.48 MB/s || | 550 | 1 | 110.000 MHz || 6.62 MB/s || 47.47 MB/s || 45.92 MB/s || | 532 | 1 | 125.000 MHz || 6.83 MB/s || 46.11 MB/s || 44.57 MB/s || ^  CONFIG: sd_overclock=100 ^^^^^^^^^^ | 400 | 0 | 100.000 MHz || 16.46 MB/s || 43.12 MB/s || 40.00 MB/s || ^ [[:hardware:raspberry_pi:sdcard_overclock:teamgroup_128gb_microsdxc_class10_uhs-i_u3_v30_a1|TeamGroup 128GB MicroSDXC Class10 UHS-I U3 V30 A1]] ^^^^^^^^^^ ^ Windows CrystalDiskMark ^^^^^^^^^^ ^  SEQ1M Q8T1 ^ Read | 98.512 MB/s ^ Write | 55.455 MB/s ^ SEQ1M Q1T1 ^ Read | 96.388 MB/s ^ Write | 52.610 MB/s | ^ Raspberry Pi Benchmarks (AVG) ^^^^^^^^^^ ^ core_freq ^ turbo ^ sd clock ^^ WRITE(dd) ^^ READ(dd) ^^ HDPARM ^^ ^  CONFIG: default ^^^^^^^^^^ | 400 | 0 | 50.000 MHz || 11.59 MB/s || 22.22 MB/s || 21.10 MB/s || ^  CONFIG: force_turbo=1,core_freq=532,sd_overclock=100 (安定常用可能🤤) ^^^^^^^^^^ | 532 | 1 | 88.667 MHz || 13.55 MB/s || 37.45 MB/s || 37.08 MB/s || | 515 | 1 | 85.833 MHz || 14.37 MB/s || 36.81 MB/s || 35.64 MB/s || | 510 | 1 | 85.000 MHz || 13.56 MB/s || 36.28 MB/s || 35.60 MB/s || | 500 | 1 | 71.429 MHz || 12.80 MB/s || 30.77 MB/s || 30.56 MB/s || ^  CONFIG: sd_overclock=100 (指定しても 80 MHz 動作) ^^^^^^^^^^ | 400 | 0 | 80.000 MHz || 12.38 MB/s || 33.19 MB/s || 26.37 MB/s || | 400 | 1 | 80.000 MHz || 13.63 MB/s || 34.74 MB/s || 33.40 MB/s || ===== ベンチスクリプト ===== {{:hardware:raspberry_pi:sdbench.sh|sdbench.sh (修正)}}\\ #!/bin/bash APPLICATION_NAME="SD Bench" APPLICATION_VERSION="0.0.1" LANG=C LC_ALL= DATAMB=512 FILENM=~/test.dat [ -f /flash/config.txt ] && CONFIG=/flash/config.txt || CONFIG=/boot/config.txt trap "rm -f ${FILENM}" EXIT [ "$(whoami)" == "root" ] || { echo "Must be run as root!"; exit 1; } HDCMD="hdparm -t --direct /dev/mmcblk0 | grep Timing" WRCMD="rm -f ${FILENM} && sync && dd if=/dev/zero of=${FILENM} bs=1M count=${DATAMB} conv=fsync 2>&1 | grep -v records" RDCMD="echo 3 > /proc/sys/vm/drop_caches && sync && dd if=${FILENM} of=/dev/null bs=1M 2>&1 | grep -v records" #grep OpenELEC /etc/os-release >/dev/null && DDTIME=5 || DDTIME=6 DDTIME=8 str_repeat() { str=$1 count=$2 echo "`printf %${count}s | sed "s/ /${str}/g"`" } getperfmbs() { local cmd="${1}" fcount="${2}" ftime="${3}" bormb="${4}" local result count _time perf result="$(eval "${cmd}")" count="$(echo "${result}" | awk "{print \$${fcount}}")" _time="$(echo "${result}" | awk "{print \$${ftime}}")" if [ "${bormb}" == "MB" ]; then perf="$(echo "${count}" "${_time}" | awk '{printf("%0.2f", $1/$2)}')" else perf="$(echo "${count}" "${_time}" | awk '{printf("%0.2f", $1/$2/1024/1024)}')" fi echo "${perf}" echo "${result}" >&2 } getavgmbs() { echo "${1} ${2} ${3}" | awk '{r=($1 + $2 + $3)/3.0; printf("%0.2f MB/s",r)}' } systemctl stop kodi 2>/dev/null #clear sync [ -f /sys/kernel/debug/mmc0/ios ] || mount -t debugfs none /sys/kernel/debug gethwinfo() { conf_core_freq="$(grep -E "^core_freq" ${CONFIG})" conf_sd_overclock="$(grep -E "^dtoverlay|^dtparam" ${CONFIG} | grep -E "mmc|sdhost|sd_overclock")" conf=("${conf_core_freq}" "${conf_sd_overclock}") for idx in "${!conf[@]}"; do [ -z "${conf[$idx]}" ] && unset -v 'conf[$idx]'; done [ -z "${conf[*]}" ] && conf=("default") clock_sdbus="$(grep "actual clock" /sys/kernel/debug/mmc0/ios 2>/dev/null | awk '{printf("%0.3f MHz", $3/1000000)}')" clock_arm="$(vcgencmd measure_clock arm | awk -F= '{printf("%0.3f MHz", $2/1000000)}')" clock_sdram="$(vcgencmd get_config int | grep sdram_freq | awk -F= '{print $2}')" soc_temp="$(cat /sys/class/thermal/thermal_zone0/temp | awk '{printf("%0.3f ℃", $1/1000)}')" volt_core="$(vcgencmd measure_volts core | awk -F= '{print $2}')" volt_sdram_c="$(vcgencmd measure_volts sdram_c | awk -F= '{print $2}')" volt_sdram_i="$(vcgencmd measure_volts sdram_i | awk -F= '{print $2}')" volt_sdram_p="$(vcgencmd measure_volts sdram_p | awk -F= '{print $2}')" core_now="$(vcgencmd measure_clock core | awk -F= '{print $2/1000000}')" core_max="$(vcgencmd get_config int | grep core_freq | awk -F= '{print $2}')" turbo="$(vcgencmd get_config int | grep force_turbo | awk -F= '{print $2}')" [ -n "${turbo}" ] || turbo=0 [ ${turbo} -eq 0 ] && turbo="$(cat /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy)" [ -n "${core_max}" ] || core_max="${core_now}" } version() { printf "$APPLICATION_NAME Ver $APPLICATION_VERSION" } main() { command_name="sdbench" command="$1" case "$command" in "-h" | "--help" ) echo $(version) printf "%6s %-50s\n" "Usage:" "$command_name [-h|--help]" printf "%6s %-50s\n" "" "$command_name [-i|--info]" printf "%6s %-50s\n" "" "$command_name [data size (MB)]" echo exit 0 ;; "-i" | "--info" ) INFO_ONRY=1 ;; * ) if [[ "$command" =~ ^[0-9]+$ ]]; then INFO_ONRY="" DATAMB=${1:-512} elif [ -n "$command" ]; then echo "Invaled option: '$1'" exit -1 fi ;; esac gethwinfo echo printf "$(str_repeat "=" 10) $(version) $(str_repeat "=" 10)\n" bak_ifs=$IFS echo "CONFIG: $(IFS=", "; echo "${conf[*]}")" IFS=$bak_ifs echo "CLOCK : SD Bus: ${clock_sdbus}, CPU: ${clock_arm}, CPU Temp: ${soc_temp}, SDRAM: ${clock_sdram} MHz" echo "VOLTS : core: ${volt_core}, sdram(controller, I/O, physical): ${volt_sdram_c}, ${volt_sdram_i}, ${volt_sdram_p}" echo "CORE : ${core_max} MHz(${core_now} MHz), turbo=${turbo}" echo "DATA : ${DATAMB} MB, ${FILENM}" echo if [ -n "$INFO_ONRY" ]; then exit 0 fi echo "HDPARM:" echo $(str_repeat "=" 6) HD1="$(getperfmbs "${HDCMD}" 5 8 MB)" HD2="$(getperfmbs "${HDCMD}" 5 8 MB)" HD3="$(getperfmbs "${HDCMD}" 5 8 MB)" HDA="$(getavgmbs "${HD1}" "${HD2}" "${HD3}")" echo echo "WRITE:" echo $(str_repeat "=" 5) WR1="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)" WR2="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)" WR3="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)" WRA="$(getavgmbs "${WR1}" "${WR2}" "${WR3}")" echo echo "READ:" echo $(str_repeat "=" 4) RD1="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)" RD2="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)" RD3="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)" RDA="$(getavgmbs "${RD1}" "${RD2}" "${RD3}")" gethwinfo echo echo "RESULT (AVG):" echo $(str_repeat "=" 12) printf "%9s %7s %12s %11s %11s %13s\n" "core_freq" "turbo" "sd clock" "WRITE" "READ" "HDPARM" printf " %d %d %11s %10s %10s %10s\n" "${core_max}" "${turbo}" "${clock_sdbus}" "${WRA}" "${RDA}" "${HDA}" echo echo "microSD card benchmark complete!" echo "CPU Temp: ${soc_temp}" echo } main "$*" 元になったオリジナルのスクリプトは http://www.nmacleod.com/public/sdbench.sh です。\\ 参考 [[https://www.bnote.net/raspberry_pi/info_cmd.html|Raspberry Pi の OS に関する情報やハードウェアの情報を得る - bnote]]\\ ===== TOSHIBA EXCERIA 32GB microSDHC Class3 UHS-I U3 ===== {{hardware:sdcard_bench_toshiba_exceria_32gb_uhs3_micro_sdhc_001.jpg?100|TOSHIBA EXCERIA 32GB microSDHC Class10 UHS-I U3 001}}\\ ==== 参考: Windows での CrystalDiskMark ==== Kingston UHS-II SD Reader USB Device, exFAT\\ {{:hardware:toshiba_exceria_32gb_microsdhc_class3_uhs-i_u3_002_king_exfat.png?800|TOSHIBA EXCERIA 32GB MicroSDHC Class10 UHS-I U3 002 King exFAT}}\\ ------------------------------------------------------------------------------ CrystalDiskMark 7.0.0 x64 (C) 2007-2019 hiyohiyo Crystal Dew World: https://crystalmark.info/ ------------------------------------------------------------------------------ * MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s] * KB = 1000 bytes, KiB = 1024 bytes [Read] Sequential 1MiB (Q= 8, T= 1): 97.552 MB/s [ 93.0 IOPS] < 85037.34 us> Sequential 1MiB (Q= 1, T= 1): 95.505 MB/s [ 91.1 IOPS] < 10957.39 us> Random 4KiB (Q= 32, T=16): 8.475 MB/s [ 2069.1 IOPS] <128238.92 us> Random 4KiB (Q= 1, T= 1): 5.920 MB/s [ 1445.3 IOPS] < 690.47 us> [Write] Sequential 1MiB (Q= 8, T= 1): 57.942 MB/s [ 55.3 IOPS] <142239.11 us> Sequential 1MiB (Q= 1, T= 1): 59.038 MB/s [ 56.3 IOPS] < 17703.84 us> Random 4KiB (Q= 32, T=16): 0.258 MB/s [ 63.0 IOPS] <645155.98 us> Random 4KiB (Q= 1, T= 1): 0.206 MB/s [ 50.3 IOPS] < 19796.31 us> Profile: Default Test: 1 GiB (x5) [Interval: 5 sec] Date: 2021/08/08 4:57:13 OS: Windows 10 Professional [10.0 Build 21322] (x64) ==== SD カード属性情報🤤 ==== $ sudo apt install python3 $ curl -O https://www.tomoyan.net/_media/hardware/sd_memory_card/read_sd_attr.py $ chmod +x read_sd_attr.py $ python3 read_sd_attr.py ===== SD and MMC Block Device Attributes Reader Ver 0.02 ===== device: /sys/block/mmcblk0/device ---------------------------------------- cid: 02544d554330443320e834cba100f2fb\n csd: 400e00325b590000e8ff7f800a4000af\n scr: 02b5840332022902\n date: 02/2015\n fwrev: 0x0\n hwrev: 0x2\n manfid: 0x000002\n name: UC0D3\n oemid: 0x544d\n ('TM') prv: None serial: 0xe834cba1\n erase_size: 512\n preferred_erase_size: 4194304\n raw_rpmb_size_mult: None rel_sectors: None ocr: 0x00200000\n dsr: 0x404\n cmdq_en: None ---------------------------------------- ==== オーバークロック前のベンチマーク ==== SD カードがオーバークロックされていない状態を、Kernel のデバッグ情報で確認する。\\ $ sudo cat /sys/kernel/debug/mmc0/ios clock: 50000000 Hz actual clock: 50000000 Hz vdd: 21 (3.3 ~ 3.4 V) bus mode: 2 (push-pull) chip select: 0 (don't care) power mode: 2 (on) bus width: 2 (4 bits) timing spec: 2 (sd high-speed) signal voltage: 0 (3.30 V) driver type: 0 (driver type B) ベンチマークスクリプトをダウンロードする。\\ $ curl -O https://www.tomoyan.net/_media/hardware/raspberry_pi/sdbench.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2922 100 2922 0 0 2690 0 0:00:01 0:00:01 --:--:-- 2693 $ curl -O https://raw.githubusercontent.com/geerlingguy/raspberry-pi-dramble/master/setup/benchmarks/microsd-benchmarks.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2247 100 2247 0 0 4642 0 --:--:-- --:--:-- --:--:-- 4632 実行可能属性を設定する。\\ $ chmod +x sdbench.sh $ chmod +x microsd-benchmarks.sh ベンチマークを実行する。\\ ※ sdbench.sh は hdparm コマンドを使用するので、予めインストールしておく。(DietPi は標準でインストールされている)\\ $ sudo apt install hdparm\\ $ sudo ./sdbench.sh CONFIG: CLOCK : 50.000 MHz CORE : 400 MHz, turbo=0 DATA : 512 MB, /root/test.dat HDPARM: ====== HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 66 MB in 3.08 seconds = 21.45 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 66 MB in 3.08 seconds = 21.42 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 66 MB in 3.08 seconds = 21.42 MB/sec WRITE: ===== 536870912 bytes (537 MB, 512 MiB) copied, 34.9133 s, 15.4 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 32.3773 s, 16.6 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 40.5927 s, 13.2 MB/s READ: ==== 536870912 bytes (537 MB, 512 MiB) copied, 23.0244 s, 23.3 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 23.0492 s, 23.3 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 22.9968 s, 23.3 MB/s RESULT (AVG): ============ core_freq turbo sd clock WRITE READ HDPARM 400 0 50.000 MHz 14.36 MB/s 22.24 MB/s 21.43 MB/s 初回実行時は、インストールとビルドが行なわれてからベンチマークが実行される。\\ $ sudo ./microsd-benchmarks.sh Raspberry Pi Dramble microSD benchmarks microSD clock: 50.000 MHz Installing build tools... パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 以下の追加パッケージがインストールされます: binutils binutils-arm-linux-gnueabihf binutils-common cpp cpp-8 dpkg-dev g++ g++-8 gcc gcc-8 libasan5 libbinutils libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libfl2 libgcc-8-dev libgomp1 libisl19 libmpc3 libmpfr6 libstdc++-8-dev libubsan1 linux-libc-dev make patch xz-utils 提案パッケージ: binutils-doc cpp-doc gcc-8-locales debian-keyring gcc-8-doc libstdc++6-8-dbg gcc-multilib manpages-dev autoconf automake libtool flex bison gdb gcc-doc libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan5-dbg liblsan0-dbg libtsan0-dbg libubsan1-dbg libmpx2-dbg libquadmath0-dbg glibc-doc bzr libstdc++-8-doc make-doc ed diffutils-doc 推奨パッケージ: fakeroot libalgorithm-merge-perl manpages manpages-dev libfile-fcntllock-perl 以下のパッケージが新たにインストールされます: binutils binutils-arm-linux-gnueabihf binutils-common build-essential cpp cpp-8 dpkg-dev g++ g++-8 gcc gcc-8 libasan5 libbinutils libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libfl2 libgcc-8-dev libgomp1 libisl19 libmpc3 libmpfr6 libstdc++-8-dev libubsan1 linux-libc-dev make patch xz-utils アップグレード: 0 個、新規インストール: 29 個、削除: 0 個、保留: 5 個。 36.9 MB のアーカイブを取得する必要があります。 この操作後に追加で 138 MB のディスク容量が消費されます。 取得:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf xz-utils armhf 5.2.4-1 [179 kB] 取得:2 http://raspbian.raspberrypi.org/raspbian buster/main armhf binutils-common armhf 2.31.1-16+rpi2 [2,075 kB] 取得:3 https://archive.raspberrypi.org/debian buster/main armhf linux-libc-dev armhf 1:1.20210805-1 [1,012 kB] 取得:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf libbinutils armhf 2.31.1-16+rpi2 [302 kB] 取得:5 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libfl2 armhf 2.6.4-6.2 [103 kB] 取得:6 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf binutils-arm-linux-gnueabihf armhf 2.31.1-16+rpi2 [1,814 kB] 取得:7 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf binutils armhf 2.31.1-16+rpi2 [57.0 kB] 取得:8 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libc-dev-bin armhf 2.28-10+rpi1 [266 kB] 取得:9 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libc6-dev armhf 2.28-10+rpi1 [2,113 kB] 取得:10 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libisl19 armhf 0.20-2 [439 kB] 取得:11 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libmpfr6 armhf 4.0.2-1 [723 kB] 取得:12 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libmpc3 armhf 1.1.0-1 [32.1 kB] 取得:13 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf cpp-8 armhf 8.3.0-6+rpi1 [6,787 kB] 取得:14 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf cpp armhf 4:8.3.0-1+rpi2 [19.6 kB] 取得:15 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libcc1-0 armhf 8.3.0-6+rpi1 [37.9 kB] 取得:16 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libgomp1 armhf 8.3.0-6+rpi1 [64.3 kB] 取得:17 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libasan5 armhf 8.3.0-6+rpi1 [317 kB] 取得:18 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libubsan1 armhf 8.3.0-6+rpi1 [103 kB] 取得:19 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libgcc-8-dev armhf 8.3.0-6+rpi1 [595 kB] 取得:24 http://raspbian.raspberrypi.org/raspbian buster/main armhf g++ armhf 4:8.3.0-1+rpi2 [1,632 B] 取得:20 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf gcc-8 armhf 8.3.0-6+rpi1 [7,223 kB] 取得:21 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf gcc armhf 4:8.3.0-1+rpi2 [5,200 B] 取得:22 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libstdc++-8-dev armhf 8.3.0-6+rpi1 [1,545 kB] 取得:23 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf g++-8 armhf 8.3.0-6+rpi1 [7,464 kB] 取得:25 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf make armhf 4.2.1-1.2 [321 kB] 取得:26 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf libdpkg-perl all 1.19.7 [1,414 kB] 取得:27 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf patch armhf 2.7.6-3+deb10u1 [115 kB] 取得:28 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf dpkg-dev all 1.19.7 [1,773 kB] 取得:29 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian buster/main armhf build-essential armhf 12.6 [7,568 B] 36.9 MB を 44秒 で取得しました (834 kB/s) debconf: delaying package configuration, since apt-utils is not installed 以前に未選択のパッケージ xz-utils を選択しています。 (データベースを読み込んでいます ... 現在 26423 個のファイルとディレクトリがインストールされています 。) .../00-xz-utils_5.2.4-1_armhf.deb を展開する準備をしています ... xz-utils (5.2.4-1) を展開しています... 以前に未選択のパッケージ binutils-common:armhf を選択しています。 .../01-binutils-common_2.31.1-16+rpi2_armhf.deb を展開する準備をしています ... binutils-common:armhf (2.31.1-16+rpi2) を展開しています... 以前に未選択のパッケージ libbinutils:armhf を選択しています。 .../02-libbinutils_2.31.1-16+rpi2_armhf.deb を展開する準備をしています ... libbinutils:armhf (2.31.1-16+rpi2) を展開しています... 以前に未選択のパッケージ libfl2:armhf を選択しています。 .../03-libfl2_2.6.4-6.2_armhf.deb を展開する準備をしています ... libfl2:armhf (2.6.4-6.2) を展開しています... 以前に未選択のパッケージ binutils-arm-linux-gnueabihf を選択しています。 .../04-binutils-arm-linux-gnueabihf_2.31.1-16+rpi2_armhf.deb を展開する準備をしています ... binutils-arm-linux-gnueabihf (2.31.1-16+rpi2) を展開しています... 以前に未選択のパッケージ binutils を選択しています。 .../05-binutils_2.31.1-16+rpi2_armhf.deb を展開する準備をしています ... binutils (2.31.1-16+rpi2) を展開しています... 以前に未選択のパッケージ libc-dev-bin を選択しています。 .../06-libc-dev-bin_2.28-10+rpi1_armhf.deb を展開する準備をしています ... libc-dev-bin (2.28-10+rpi1) を展開しています... 以前に未選択のパッケージ linux-libc-dev:armhf を選択しています。 .../07-linux-libc-dev_1%3a1.20210805-1_armhf.deb を展開する準備をしています ... linux-libc-dev:armhf (1:1.20210805-1) を展開しています... 以前に未選択のパッケージ libc6-dev:armhf を選択しています。 .../08-libc6-dev_2.28-10+rpi1_armhf.deb を展開する準備をしています ... libc6-dev:armhf (2.28-10+rpi1) を展開しています... 以前に未選択のパッケージ libisl19:armhf を選択しています。 .../09-libisl19_0.20-2_armhf.deb を展開する準備をしています ... libisl19:armhf (0.20-2) を展開しています... 以前に未選択のパッケージ libmpfr6:armhf を選択しています。 .../10-libmpfr6_4.0.2-1_armhf.deb を展開する準備をしています ... libmpfr6:armhf (4.0.2-1) を展開しています... 以前に未選択のパッケージ libmpc3:armhf を選択しています。 .../11-libmpc3_1.1.0-1_armhf.deb を展開する準備をしています ... libmpc3:armhf (1.1.0-1) を展開しています... 以前に未選択のパッケージ cpp-8 を選択しています。 .../12-cpp-8_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... cpp-8 (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ cpp を選択しています。 .../13-cpp_4%3a8.3.0-1+rpi2_armhf.deb を展開する準備をしています ... cpp (4:8.3.0-1+rpi2) を展開しています... 以前に未選択のパッケージ libcc1-0:armhf を選択しています。 .../14-libcc1-0_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... libcc1-0:armhf (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ libgomp1:armhf を選択しています。 .../15-libgomp1_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... libgomp1:armhf (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ libasan5:armhf を選択しています。 .../16-libasan5_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... libasan5:armhf (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ libubsan1:armhf を選択しています。 .../17-libubsan1_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... libubsan1:armhf (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ libgcc-8-dev:armhf を選択しています。 .../18-libgcc-8-dev_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... libgcc-8-dev:armhf (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ gcc-8 を選択しています。 .../19-gcc-8_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... gcc-8 (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ gcc を選択しています。 .../20-gcc_4%3a8.3.0-1+rpi2_armhf.deb を展開する準備をしています ... gcc (4:8.3.0-1+rpi2) を展開しています... 以前に未選択のパッケージ libstdc++-8-dev:armhf を選択しています。 .../21-libstdc++-8-dev_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... libstdc++-8-dev:armhf (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ g++-8 を選択しています。 .../22-g++-8_8.3.0-6+rpi1_armhf.deb を展開する準備をしています ... g++-8 (8.3.0-6+rpi1) を展開しています... 以前に未選択のパッケージ g++ を選択しています。 .../23-g++_4%3a8.3.0-1+rpi2_armhf.deb を展開する準備をしています ... g++ (4:8.3.0-1+rpi2) を展開しています... 以前に未選択のパッケージ make を選択しています。 .../24-make_4.2.1-1.2_armhf.deb を展開する準備をしています ... make (4.2.1-1.2) を展開しています... 以前に未選択のパッケージ libdpkg-perl を選択しています。 .../25-libdpkg-perl_1.19.7_all.deb を展開する準備をしています ... libdpkg-perl (1.19.7) を展開しています... 以前に未選択のパッケージ patch を選択しています。 .../26-patch_2.7.6-3+deb10u1_armhf.deb を展開する準備をしています ... patch (2.7.6-3+deb10u1) を展開しています... 以前に未選択のパッケージ dpkg-dev を選択しています。 .../27-dpkg-dev_1.19.7_all.deb を展開する準備をしています ... dpkg-dev (1.19.7) を展開しています... 以前に未選択のパッケージ build-essential を選択しています。 .../28-build-essential_12.6_armhf.deb を展開する準備をしています ... build-essential (12.6) を展開しています... binutils-common:armhf (2.31.1-16+rpi2) を設定しています ... linux-libc-dev:armhf (1:1.20210805-1) を設定しています ... libgomp1:armhf (8.3.0-6+rpi1) を設定しています ... libasan5:armhf (8.3.0-6+rpi1) を設定しています ... make (4.2.1-1.2) を設定しています ... libmpfr6:armhf (4.0.2-1) を設定しています ... xz-utils (5.2.4-1) を設定しています ... update-alternatives: /usr/bin/lzma (lzma) を提供するために自動モードで /usr/bin/xz を使います libmpc3:armhf (1.1.0-1) を設定しています ... patch (2.7.6-3+deb10u1) を設定しています ... libfl2:armhf (2.6.4-6.2) を設定しています ... libdpkg-perl (1.19.7) を設定しています ... libubsan1:armhf (8.3.0-6+rpi1) を設定しています ... libisl19:armhf (0.20-2) を設定しています ... libbinutils:armhf (2.31.1-16+rpi2) を設定しています ... cpp-8 (8.3.0-6+rpi1) を設定しています ... libc-dev-bin (2.28-10+rpi1) を設定しています ... binutils-arm-linux-gnueabihf (2.31.1-16+rpi2) を設定しています ... libcc1-0:armhf (8.3.0-6+rpi1) を設定しています ... binutils (2.31.1-16+rpi2) を設定しています ... dpkg-dev (1.19.7) を設定しています ... libgcc-8-dev:armhf (8.3.0-6+rpi1) を設定しています ... cpp (4:8.3.0-1+rpi2) を設定しています ... libc6-dev:armhf (2.28-10+rpi1) を設定しています ... libstdc++-8-dev:armhf (8.3.0-6+rpi1) を設定しています ... gcc-8 (8.3.0-6+rpi1) を設定しています ... gcc (4:8.3.0-1+rpi2) を設定しています ... g++-8 (8.3.0-6+rpi1) を設定しています ... g++ (4:8.3.0-1+rpi2) を設定しています ... update-alternatives: /usr/bin/c++ (c++) を提供するために自動モードで /usr/bin/g++ を使います build-essential (12.6) を設定しています ... libc-bin (2.28-10+rpi1) のトリガを処理しています ... Install complete! Installing iozone... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4040k 100 4040k 0 0 370k 0 0:00:10 0:00:10 --:--:-- 516k Building iozone for Linux-arm Building fileop for Linux-arm Building the pit_server Install complete! Running hdparm test... /dev/mmcblk0: HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 68 MB in 3.06 seconds = 22.21 MB/sec Running dd test... 51200+0 レコード入力 51200+0 レコード出力 419430400 bytes (419 MB, 400 MiB) copied, 28.0597 s, 14.9 MB/s Running iozone test... Iozone: Performance Test of File I/O Version $Revision: 3.488 $ Compiled for 32 bit mode. Build: linux-arm Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins Al Slater, Scott Rhine, Mike Wisner, Ken Goss Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR, Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner, Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer, Vangel Bojaxhi, Ben England, Vikentsi Lapa, Alexey Skidanov, Sudhir Kumar. Run began: Wed Aug 11 14:05:56 2021 Include fsync in write timing O_DIRECT feature enabled Auto Mode File size set to 102400 kB Record Size 4 kB Command line used: ./iozone -e -I -a -s 100M -r 4k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 102400 4 850 858 6349 6353 6269 284 iozone test complete. microSD card benchmark complete! Raspberry Pi Dramble microSD benchmarks microSD clock: 50.000 MHz Running hdparm test... /dev/mmcblk0: HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 68 MB in 3.06 seconds = 22.21 MB/sec Running dd test... 51200+0 レコード入力 51200+0 レコード出力 419430400 bytes (419 MB, 400 MiB) copied, 28.0597 s, 14.9 MB/s Running iozone test... Iozone: Performance Test of File I/O Version $Revision: 3.488 $ Compiled for 32 bit mode. Build: linux-arm Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins Al Slater, Scott Rhine, Mike Wisner, Ken Goss Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR, Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner, Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer, Vangel Bojaxhi, Ben England, Vikentsi Lapa, Alexey Skidanov, Sudhir Kumar. Run began: Wed Aug 11 14:05:56 2021 Include fsync in write timing O_DIRECT feature enabled Auto Mode File size set to 102400 kB Record Size 4 kB Command line used: ./iozone -e -I -a -s 100M -r 4k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 102400 4 850 858 6349 6353 6269 284 iozone test complete. microSD card benchmark complete! ==== オーバークロックの設定と再起動 ==== 管理者で **config.txt** に SD カードのオーバークロック設定を行って再起動する😍\\ $ sudo bash -c 'printf "dtparam=sd_overclock=100\n" >> /boot/config.txt' $ sudo bash -c 'printf "force_turbo=1\n" >> /boot/config.txt' $ sudo reboot dtoverlay=sdhost,overclock_50=100 で sdhost オーバーレイにオーバークロックを指示すると Wi-Fi 接続不能になるなど問題が発生した。dtparam=sd_overclock=100 で指示すれば問題は発生しない。\\ 参考: [[https://www.raspberrypi.org/forums/viewtopic.php?t=195895|SD-Card-Overclock - Raspberry Pi Forums]]\\ 再起動したら dmesg で設定が有効になっていることを確認する🤔\\ $ dmesg | grep mmc0 [ 2.735457] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1) [ 2.911272] mmc0: host does not support reading read-only switch, assuming write-enable [ 2.913917] mmc0: overclocking to 100000000Hz [ 2.914133] mmc0: new high speed SDHC card at address e5ea [ 2.915520] mmcblk0: mmc0:e5ea UC0D3 29.1 GiB mmc0: overclocking to 100000000Hz が dmesg に記録されていれば設定が適用されている。\\ カーネルのデバッグ情報でも確認できる😎\\ $ sudo cat /sys/kernel/debug/mmc0/ios clock: 50000000 Hz actual clock: 100000000 Hz vdd: 21 (3.3 ~ 3.4 V) bus mode: 2 (push-pull) chip select: 0 (don't care) power mode: 2 (on) bus width: 2 (4 bits) timing spec: 2 (sd high-speed) signal voltage: 0 (3.30 V) driver type: 0 (driver type B) ==== オーバークロック後のベンチマーク ==== オーバークロックが有効な状態で再度ベンチマークを実行して性能を評価する🤔\\ $ sudo ./sdbench.sh CONFIG: dtparam=sd_overclock=100 CLOCK : 100.000 MHz CORE : 400 MHz, turbo=0 DATA : 512 MB, /root/test.dat HDPARM: ====== HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 122 MB in 3.05 seconds = 40.00 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 120 MB in 3.00 seconds = 39.98 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 120 MB in 3.00 seconds = 39.95 MB/sec WRITE: ===== 536870912 bytes (537 MB, 512 MiB) copied, 31.0221 s, 17.3 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 29.8331 s, 18.0 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 32.5621 s, 16.5 MB/s READ: ==== 536870912 bytes (537 MB, 512 MiB) copied, 11.9419 s, 45.0 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 11.8501 s, 45.3 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 11.8313 s, 45.4 MB/s RESULT (AVG): ============ core_freq turbo sd clock WRITE READ HDPARM 400 0 100.000 MHz 16.46 MB/s 43.12 MB/s 40.00 MB/s $ sudo ./microsd-benchmarks.sh Raspberry Pi Dramble microSD benchmarks microSD clock: 100.000 MHz Running hdparm test... /dev/mmcblk0: HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 124 MB in 3.01 seconds = 41.20 MB/sec Running dd test... 51200+0 レコード入力 51200+0 レコード出力 419430400 bytes (419 MB, 400 MiB) copied, 29.1576 s, 14.4 MB/s Running iozone test... Iozone: Performance Test of File I/O Version $Revision: 3.488 $ Compiled for 32 bit mode. Build: linux-arm Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins Al Slater, Scott Rhine, Mike Wisner, Ken Goss Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR, Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner, Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer, Vangel Bojaxhi, Ben England, Vikentsi Lapa, Alexey Skidanov, Sudhir Kumar. Run began: Wed Aug 11 15:50:18 2021 Include fsync in write timing O_DIRECT feature enabled Auto Mode File size set to 102400 kB Record Size 4 kB Command line used: ./iozone -e -I -a -s 100M -r 4k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 102400 4 834 852 6902 6908 6779 286 iozone test complete. microSD card benchmark complete! オーバークロック周波数に 133 MHz を試しに設定してみたら、125 MHz に引き上げられましたが、ベンチマークの最中に I/O エラーとバス🚌エラーでご臨終🙏しました😢\\ ファイルシステムなどは破損していませんが、不安定で Raspberry Pi からは config.txt を直せない場合がありますあります🤔その場合は、PC に SD カードを刺して設定を戻せば大丈夫👌です😉\\ $ sudo ./sdbench.sh CONFIG: dtparam=sd_overclock=133 CLOCK : 125.000 MHz CORE : 400 MHz, turbo=0 DATA : 512 MB, /root/test.dat HDPARM: ====== HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 120 MB in 3.01 seconds = 39.85 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 120 MB in 3.02 seconds = 39.74 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 120 MB in 3.02 seconds = 39.72 MB/sec WRITE: ===== dd: error writing '/root/test.dat': Read-only file system 407023616 bytes (407 MB, 388 MiB) copied, 21.0707 s, 19.3 MB/s ./sdbench.sh: line 23: /usr/bin/rm: Input/output error ./sdbench.sh: line 23: /usr/bin/rm: Input/output error READ: ==== ./sdbench.sh: line 23: /usr/bin/sync: Input/output error ./sdbench.sh: line 24: awk: command not found ./sdbench.sh: line 25: awk: command not found ./sdbench.sh: line 29: awk: command not found ./sdbench.sh: error reading input file: Input/output error バスエラー ===== TeamGroup 128GB microSDXC Class10 UHS-I U3 V30 A1 ===== {{:hardware:sdcard_bench_team_group_128gb_class10_uhs-i_micro_sdxc_001.jpg?100|TeamGroup 128GB microSDXC Class10 UHS-I U3 V30 A1 001}}\\ ==== 参考: Windows での CrystalDiskMark ==== ==== SD カード属性情報🤤 ==== $ python3 read_sd_attr.py ===== SD and MMC Block Device Attributes Reader Ver 0.02 ===== device: /sys/block/mmcblk0/device ---------------------------------------- cid: 452d4220202020201014a11ed90149a9\n csd: 400e00325b590003ae077f800a400001\n scr: 0245844300000000\n date: 09/2020\n fwrev: 0x0\n hwrev: 0x1\n manfid: 0x000045\n name: \n oemid: 0x2d42\n ('-B') prv: None serial: 0x14a11ed9\n erase_size: 512\n preferred_erase_size: 4194304\n raw_rpmb_size_mult: None rel_sectors: None ocr: 0x00200000\n dsr: 0x404\n cmdq_en: None ---------------------------------------- ==== オーバークロック前のベンチマーク ==== $ sudo cat /sys/kernel/debug/mmc0/ios clock: 50000000 Hz actual clock: 50000000 Hz vdd: 21 (3.3 ~ 3.4 V) bus mode: 2 (push-pull) chip select: 0 (don't care) power mode: 2 (on) bus width: 2 (4 bits) timing spec: 2 (sd high-speed) signal voltage: 0 (3.30 V) driver type: 0 (driver type B) ベンチマークを実行する🤔\\ $ sudo ./sdbench.sh CONFIG: CLOCK : 50.000 MHz CORE : 400 MHz, turbo=0 DATA : 512 MB, /root/test.dat HDPARM: ====== HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 64 MB in 3.03 seconds = 21.12 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 64 MB in 3.03 seconds = 21.11 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 64 MB in 3.04 seconds = 21.08 MB/sec WRITE: ===== 536870912 bytes (537 MB, 512 MiB) copied, 46.0372 s, 11.7 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 43.9316 s, 12.2 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 42.6504 s, 12.6 MB/s READ: ==== 536870912 bytes (537 MB, 512 MiB) copied, 23.0346 s, 23.3 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 23.0235 s, 23.3 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 23.0885 s, 23.3 MB/s RESULT (AVG): ============ core_freq turbo sd clock WRITE READ HDPARM 400 0 50.000 MHz 11.59 MB/s 22.22 MB/s 21.10 MB/s $ sudo ./microsd-benchmarks.sh Raspberry Pi Dramble microSD benchmarks microSD clock: 50.000 MHz Running hdparm test... /dev/mmcblk0: HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 68 MB in 3.06 seconds = 22.21 MB/sec Running dd test... 51200+0 レコード入力 51200+0 レコード出力 419430400 bytes (419 MB, 400 MiB) copied, 34.5449 s, 12.1 MB/s Running iozone test... Iozone: Performance Test of File I/O Version $Revision: 3.488 $ Compiled for 32 bit mode. Build: linux-arm Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins Al Slater, Scott Rhine, Mike Wisner, Ken Goss Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR, Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner, Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer, Vangel Bojaxhi, Ben England, Vikentsi Lapa, Alexey Skidanov, Sudhir Kumar. Run began: Thu Aug 12 11:37:18 2021 Include fsync in write timing O_DIRECT feature enabled Auto Mode File size set to 102400 kB Record Size 4 kB Command line used: ./iozone -e -I -a -s 100M -r 4k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 102400 4 2337 2485 5426 5423 4706 2509 iozone test complete. microSD card benchmark complete! ==== オーバークロックの設定と再起動 ==== 管理者で **config.txt** に SD カードのオーバークロック設定を行って再起動する😍\\ $ sudo bash -c 'printf "dtparam=sd_overclock=100\n" >> /boot/config.txt' $ sudo bash -c 'printf "force_turbo=1\n" >> /boot/config.txt' $ sudo reboot ==== オーバークロック後のベンチマーク ==== オーバークロックが有効な状態で再度ベンチマークを実行して性能を評価する🤔\\ **force_turboなし**\\ $ sudo ./sdbench.sh CONFIG: dtparam=sd_overclock=100 CLOCK : 80.000 MHz CORE : 400 MHz, turbo=0 DATA : 512 MB, /root/test.dat HDPARM: ====== HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 80 MB in 3.03 seconds = 26.43 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 80 MB in 3.02 seconds = 26.45 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 80 MB in 3.05 seconds = 26.27 MB/sec WRITE: ===== 536870912 bytes (537 MB, 512 MiB) copied, 41.3066 s, 13.0 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 41.5479 s, 12.9 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 41.1837 s, 13.0 MB/s READ: ==== 536870912 bytes (537 MB, 512 MiB) copied, 15.4114 s, 34.8 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 15.424 s, 34.8 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 15.4437 s, 34.8 MB/s RESULT (AVG): ============ core_freq turbo sd clock WRITE READ HDPARM 400 0 80.000 MHz 12.38 MB/s 33.19 MB/s 26.37 MB/s $ sudo ./microsd-benchmarks.sh Raspberry Pi Dramble microSD benchmarks microSD clock: 80.000 MHz Running hdparm test... /dev/mmcblk0: HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 98 MB in 3.02 seconds = 32.44 MB/sec Running dd test... 51200+0 レコード入力 51200+0 レコード出力 419430400 bytes (419 MB, 400 MiB) copied, 31.7555 s, 13.2 MB/s Running iozone test... Iozone: Performance Test of File I/O Version $Revision: 3.488 $ Compiled for 32 bit mode. Build: linux-arm Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins Al Slater, Scott Rhine, Mike Wisner, Ken Goss Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR, Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner, Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer, Vangel Bojaxhi, Ben England, Vikentsi Lapa, Alexey Skidanov, Sudhir Kumar. Run began: Thu Aug 12 12:15:37 2021 Include fsync in write timing O_DIRECT feature enabled Auto Mode File size set to 102400 kB Record Size 4 kB Command line used: ./iozone -e -I -a -s 100M -r 4k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 102400 4 2396 2532 5934 5963 5082 2518 iozone test complete. microSD card benchmark complete! **config.txt に force_turbo=1 を設定した場合**\\ $ sudo ./sdbench.sh CONFIG: dtparam=sd_overclock=100 CLOCK : 80.000 MHz CORE : 400 MHz, turbo=1 DATA : 512 MB, /root/test.dat HDPARM: ====== HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 102 MB in 3.05 seconds = 33.44 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 102 MB in 3.05 seconds = 33.40 MB/sec HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing O_DIRECT disk reads: 102 MB in 3.06 seconds = 33.36 MB/sec WRITE: ===== 536870912 bytes (537 MB, 512 MiB) copied, 38.5818 s, 13.9 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 36.6868 s, 14.6 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 37.4891 s, 14.3 MB/s READ: ==== 536870912 bytes (537 MB, 512 MiB) copied, 14.7304 s, 36.4 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 14.761 s, 36.4 MB/s 536870912 bytes (537 MB, 512 MiB) copied, 14.7272 s, 36.5 MB/s RESULT (AVG): ============ core_freq turbo sd clock WRITE READ HDPARM 400 1 80.000 MHz 13.63 MB/s 34.74 MB/s 33.40 MB/s $ sudo ./microsd-benchmarks.sh Raspberry Pi Dramble microSD benchmarks microSD clock: 80.000 MHz Running hdparm test... /dev/mmcblk0: HDIO_DRIVE_CMD(identify) failed: Invalid argument Timing buffered disk reads: 106 MB in 3.05 seconds = 34.74 MB/sec Running dd test... 51200+0 レコード入力 51200+0 レコード出力 419430400 bytes (419 MB, 400 MiB) copied, 29.9646 s, 14.0 MB/s Running iozone test... Iozone: Performance Test of File I/O Version $Revision: 3.488 $ Compiled for 32 bit mode. Build: linux-arm Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins Al Slater, Scott Rhine, Mike Wisner, Ken Goss Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR, Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner, Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer, Vangel Bojaxhi, Ben England, Vikentsi Lapa, Alexey Skidanov, Sudhir Kumar. Run began: Thu Aug 12 11:55:28 2021 Include fsync in write timing O_DIRECT feature enabled Auto Mode File size set to 102400 kB Record Size 4 kB Command line used: ./iozone -e -I -a -s 100M -r 4k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 102400 4 2408 2748 6110 6105 5177 2729 iozone test complete. microSD card benchmark complete! ===== オーバークロック検証 ===== [[:hardware:raspberry_pi:sdcard_overclock:samsung_evo_plus_128gb_microsdxc_uhs-i_u3|SAMSUNG EVO Plus 128GB microSDXC UHS-I U3]]\\ [[:hardware:raspberry_pi:sdcard_overclock:teamgroup_128gb_microsdxc_class10_uhs-i_u3_v30_a1|TeamGroup 128GB microSDXC Class10 UHS-I U3 V30 A1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:hidisc_128gb_microsdxc_class10_uhs-i_u1|HIDISC 128GB microSDXC Class10 UHS-I U1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:klevv_128gb_microsdxc_class10_uhs-i_u3_a1|KLEVV 128GB microSDXC Class10 UHS-I U3 A1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:toshiba_exceria_32gb_microsdhc_class10_uhs-i_u3|TOSHIBA EXCERIA 32GB microSDHC Class10 UHS-I U3]]\\ [[:hardware:raspberry_pi:sdcard_overclock:kingston_128gb_microsdxc_uhs-i_u1_v30_a1|Kingston 128GB microSDXC UHS-I U1 V30 A1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:sandisk_128gb_microsdxc_class10_uhs-i_u1_a1|SanDisk 128GB microSDXC Class10 UHS-I U1 A1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:kioxia_exceria_128gb_microsdxc_class10_uhs-i_u1|KIOXIA EXCERIA 128GB microSDXC Class10 UHS-I U1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:adata_8gb_microsdhc_class10_uhs-i_u1|ADATA 8GB microSDHC Class10 UHS-I U1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:transcend_128gb_microsdxc_uhs-i_u3_v30_a1|Transcend 128GB MicroSDXC UHS-I U3 V30 A1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:au_32gb_microsdhc_class10_uhs-i_u1|au 32GB MicroSDHC Class10 UHS-I U1]]\\ [[:hardware:raspberry_pi:sdcard_overclock:transcend_16gb_microsdhc_class10|Transcend 16GB microSDHC Class10]]\\ [[:hardware:raspberry_pi:sdcard_overclock:silicon_power_2gb_microsd|SILICON POWER 2GB microSD]]\\ ===== 参考文献 ===== [[https://www.raspberrypi.org/forums/viewtopic.php?t=144493|SD card speed - Raspberry Pi Forums]]\\ [[https://www.raspberrypi.org/forums/viewtopic.php?t=195895|SD-Card-Overclock - Raspberry Pi Forums]]\\ [[https://www.jeffgeerling.com/blog/2016/how-overclock-microsd-card-reader-on-raspberry-pi-3|How to overclock the microSD card reader on a Raspberry Pi 3 | Jeff Geerling]]\\ [[qita>noguhiro2002/items/60103e6bd21134cad543|Raspberry PiのMicro SDカードから配布用imageファイルを作る with Ubuntu 18.04 LTS - Qiita]]\\ [[http://fisherman.jp/23/3336|CPUクロック周波数を表示 Raspberry Pi Zero WH | 石垣島海人 fisherman.jp #23]]\\ [[https://forums.raspberrypi.com/viewtopic.php?t=131550|PiZero clock speed on RISC OS - Raspberry Pi Forums]]\\ [[https://forums.raspberrypi.com/viewtopic.php?t=249071|UPDATED: Overclocking pi zero W - Raspberry Pi Forums]]\\ [[tw>TransAmGTA92/status/1224371068820869123|ちなみに、最終的な /boot/config.txt のクロックアップ設定は以下の通り。gpu は 530 にすると、サーマルスロットリングで使い物にならなくなり、arm は 1080 でも余裕という人もいるけどオレのはNG arm_freq=1050 gpu_freq=520 over_voltage=2 core_freq=515 sdram_freq=533 over_voltage_sdram=1]]\\ [[https://forum-raspberrypi.de/forum/thread/44142-speicher-ram-des-raspberry-pi4-uebertakten/|Speicher (RAM) des Raspberry Pi4 übertakten?! - Deutsches Raspberry Pi Forum]]\\ ==== 付録 ==== [[tw>tomoyan596/status/1425366975220383747|じつは、SDカードのオーバークロックの方法が変わっていて、元にした方法で行うとWi-Fiに繫がらないとか悩むことになりますけど、あたらしくパラメータで設定する方法が存在していてRaspberry Pi Zeroで上手く出来ました😊👏👏👏 / Twitter]]\\ [[tw>tomoyan596/status/1441445004413571077|あれ❓TermさんのCrystalDiskMarkのデータが無い😭 / Twitter]]\\ [[tw>tomoyan596/status/1495573389905645569|“Linuxなら、わずか2200円税込でも快適なマシンがさらに数で勝負出来ちゃう🥰SDカードオーバークロックしますけど😅 / Twitter]]\\ [[tw>tomoyan596sp/status/1509759405746577412|KIOXIA EXCERIA 128GB microSDXC Class10 UHS-I U1core_freq=565,dtparam=sd_overclock=125SDオーバークロックは125MHz時代へ🥰dmesgで確認するとKernelがエラー吐いている時は強制的に125MHzから調整に入るのでsd_overclock=125以上を指定出来ない模様🤔Kernelの限界❓🤔]]\\ [[tw>tomoyan596sp/status/1519948839452819456|そろそろ、Raspberry Pi Zero のSD bus オーバークロック 125MHz乗用1ヶ月🤔何も問題ないのて安定乗用可能マークしておきます😊通常SD busクロックは50MHz🤔PCの1/4倍速です😅125MHzなら倍以上速いです🤤]]\\