On Tue, Mar 08, 2011 at 02:41:03PM +0100, Arnd Bergmann wrote:
On Monday 07 March 2011, Philippe De Muyter wrote:
On Mon, Mar 07, 2011 at 06:03:05PM +0100, Arnd Bergmann wrote:
Here are the results :
tmp179:/home/lcr/flashbench # ./flashbench -a -b 8192 /dev/sdb sched_setscheduler: Operation not permitted align 67108864 pre 1.49ms on 1.49ms post 1.49ms diff -2556ns align 33554432 pre 1.49ms on 1.49ms post 1.49ms diff -1001ns align 16777216 pre 1.49ms on 1.49ms post 1.49ms diff 1.29µs align 8388608 pre 1.49ms on 1.49ms post 1.48ms diff 1.52µs
The -a tests are still inconclusive. What kind of device is this? What is the total size? (in /proc/partitions) For a USB device, what is the output of lsusb? For a SD card, can you put the card into a builtin SD card reader and do 'head /sys/block/mmcblk0/device/*'?
It is a 2GB compactflash card. I do not remember the brand and model. I'll look them up tomorrow.
From `dmesg':
[ 1.202196] ata3.00: CFA: PIO, 20100202, max PIO4 [ 1.202241] ata3.00: 3980592 sectors, multi 0: LBA [ 1.202284] ata3.00: applying bridge limits [ 1.208129] ata3.00: configured for PIO4 [ 1.243481] scsi 2:0:0:0: Direct-Access ATA PIO 2010 PQ: 0 ANSI: 5 [ 1.243754] sd 2:0:0:0: [sdb] 3980592 512-byte logical blocks: (2.03 GB/1.89 GiB) [ 1.243838] sd 2:0:0:0: [sdb] Write Protect is off [ 1.243886] sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00 [ 1.243948] sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 1.245062] sdb: sdb1
From /proc/partitions:
8 16 1990296 sdb 8 17 1989760 sdb1
From `smartctl --all -T permissive /dev/sdb':
smartctl 5.40 2010-10-16 r3189 [i686-pc-linux-gnu] (SUSE RPM) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION === Device Model: PIO Serial Number: 20100716 CF100BA8 Firmware Version: 20100202 User Capacity: 2,038,063,104 bytes Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 4 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Tue Mar 8 15:37:58 2011 CET SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled. A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options. tmp179:~ # smartctl --all -T permissive /dev/sdb smartctl 5.40 2010-10-16 r3189 [i686-pc-linux-gnu] (SUSE RPM) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION === Device Model: PIO Serial Number: 20100716 CF100BA8 Firmware Version: 20100202 User Capacity: 2,038,063,104 bytes Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 4 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Tue Mar 8 15:38:44 2011 CET SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled. Checking to be sure by trying SMART RETURN STATUS command. SMART support is: Available - device has SMART capability. SMART support is: Enabled
=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED
General SMART Values: Offline data collection status: (0x26) Offline data collection activity is in a Reserved state. Auto Offline Data Collection: Disabled. Total time to complete Offline data collection: ( 3) seconds. Offline data collection capabilities: (0x00) Offline data collection not supported. SMART capabilities: (0x0002) Does not save SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x00) Error logging NOT supported. No General Purpose Logging support.
SMART Attributes Data Structure revision number: 1 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x0000 100 100 000 Old_age Offline - 0 2 Throughput_Performance 0x0000 100 100 000 Old_age Offline - 0 5 Reallocated_Sector_Ct 0x0000 100 100 000 Old_age Offline - 0 7 Seek_Error_Rate 0x0000 100 100 000 Old_age Offline - 0 8 Seek_Time_Performance 0x0000 100 100 000 Old_age Offline - 0 12 Power_Cycle_Count 0x0000 100 100 000 Old_age Offline - 39 195 Hardware_ECC_Recovered 0x0000 100 100 000 Old_age Offline - 0 196 Reallocated_Event_Count 0x0000 100 100 000 Old_age Offline - 0 197 Current_Pending_Sector 0x0000 100 100 000 Old_age Offline - 0 198 Offline_Uncorrectable 0x0000 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x0000 100 100 000 Old_age Offline - 0 200 Multi_Zone_Error_Rate 0x0000 100 100 000 Old_age Offline - 0
Warning: device does not support Error Logging Error SMART Error Log Read failed: Input/output error Smartctl: SMART Error Log Read Failed Warning: device does not support Self Test Logging Error SMART Error Self-Test Log Read failed: Input/output error Smartctl: SMART Self Test Log Read Failed Device does not support Selective Self Tests/Logging
tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=3 --erasesize=$[8 * 1024 * 1024] /dev/sdb sched_setscheduler: Operation not permitted 8MiB 2.7M/s 4MiB 4.44M/s 2MiB 5.06M/s 1MiB 5.32M/s 512KiB 5.48M/s 256KiB 5.51M/s 128KiB 5.53M/s 64KiB 5.46M/s 32KiB 5.3M/s 16KiB 4.99M/s tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=4 --erasesize=$[8 * 1024 * 1024] /dev/sdb sched_setscheduler: Operation not permitted 8MiB 3.42M/s 4MiB 4.72M/s 2MiB 5.18M/s 1MiB 5.38M/s 512KiB 5.12M/s 256KiB 4.06M/s 128KiB 2.89M/s 64KiB 1.8M/s 32KiB 1.02M/s 16KiB 546K/s
This at least is a clear result: The device can have 3 AUs open simultaneously, but not four. The performance using 512 KiB byte blocks is still ok, so the AU size might actually be as small as this.
tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=1 --erasesize=$[8 * 1024 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 8MiB 5.57M/s 4MiB 5.57M/s 2MiB 5.57M/s 1MiB 5.57M/s 512KiB 5.09M/s 256KiB 4.39M/s 128KiB 4.31M/s 64KiB 3.57M/s 32KiB 3.18M/s 16KiB 2.66M/s tmp179:/home/lcr/flashbench # ./flashbench --open-au --open-au-nr=2 --erasesize=$[8 * 1024 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 8MiB 5.2M/s 4MiB 5.39M/s 2MiB 5.53M/s 1MiB 5.53M/s 512KiB 4.79M/s 256KiB 3.95M/s 128KiB 3.37M/s 64KiB 2.49M/s 32KiB 1.95M/s 16KiB 1.48M/s
In random access, you see the performance drop already with one AU, which is a hint that the AU size is actually smaller. What you could try next is vary the erasesize argument with --random --open-au-nr=3.
When you pass the correct size, you should see the same result that you see without --random, i.e. it's always fast with --open-au-nr=3 but much slower with --open-au-nr=4.
Here are some more results :
tmp179:~ # ./flashbench --open-au --open-au-nr=3 --erasesize=$[2048 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 2MiB 5.31M/s 1MiB 5.44M/s 512KiB 5.13M/s 256KiB 4.45M/s 128KiB 4.45M/s 64KiB 4.03M/s 32KiB 3.56M/s 16KiB 3.08M/s tmp179:~ # ./flashbench --open-au --open-au-nr=3 --erasesize=$[1024 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 1MiB 5.57M/s 512KiB 5.57M/s 256KiB 5.25M/s 128KiB 4.45M/s 64KiB 5.05M/s 32KiB 4.72M/s 16KiB 4.35M/s tmp179:~ # ./flashbench --open-au --open-au-nr=3 --erasesize=$[512 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 512KiB 5.49M/s 256KiB 5.3M/s 128KiB 4.84M/s 64KiB 5.14M/s 32KiB 4.81M/s 16KiB 4.34M/s tmp179:~ # ./flashbench --open-au --open-au-nr=3 --erasesize=$[256 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 256KiB 5.5M/s 128KiB 5.49M/s 64KiB 5.32M/s 32KiB 4.84M/s 16KiB 4.41M/s tmp179:~ # ./flashbench --open-au --open-au-nr=3 --erasesize=$[128 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 128KiB 5.5M/s 64KiB 5.33M/s 32KiB 5.04M/s 16KiB 4.54M/s tmp179:~ # ./flashbench --open-au --open-au-nr=3 --erasesize=$[64 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 64KiB 5.33M/s 32KiB 5.04M/s 16KiB 4.54M/s tmp179:~ # ./flashbench --open-au --open-au-nr=4 --erasesize=$[2048 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 2MiB 5.29M/s 1MiB 5.43M/s 512KiB 4.85M/s 256KiB 3.91M/s 128KiB 3.35M/s 64KiB 3.61M/s 32KiB 3.08M/s 16KiB 2.62M/s tmp179:~ # ./flashbench --open-au --open-au-nr=4 --erasesize=$[1024 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 1MiB 5.29M/s 512KiB 5.1M/s 256KiB 4.28M/s 128KiB 4.55M/s 64KiB 4.94M/s 32KiB 4.62M/s 16KiB 4.34M/s tmp179:~ # ./flashbench --open-au --open-au-nr=4 --erasesize=$[512 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 512KiB 5.52M/s 256KiB 5.11M/s 128KiB 4.78M/s 64KiB 5.05M/s 32KiB 4.85M/s 16KiB 4.34M/s tmp179:~ # ./flashbench --open-au --open-au-nr=4 --erasesize=$[256 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 256KiB 5.5M/s 128KiB 5.49M/s 64KiB 4.97M/s 32KiB 4.72M/s 16KiB 4.34M/s tmp179:~ # ./flashbench --open-au --open-au-nr=4 --erasesize=$[128 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 128KiB 5.5M/s 64KiB 5.31M/s 32KiB 5.03M/s 16KiB 4.41M/s tmp179:~ # ./flashbench --open-au --open-au-nr=4 --erasesize=$[64 * 1024] /dev/sdb --random sched_setscheduler: Operation not permitted 64KiB 5.33M/s 32KiB 5.03M/s 16KiB 4.54M/s tmp179:~ #
Philippe