On Wednesday 20 June 2012, Andrew Bradford wrote:
On Fri, Jun 15, 2012, at 07:44 PM, Arnd Bergmann wrote:
On Wednesday 13 June 2012, Andrew Bradford wrote:
No, I think it's just what the scsi host reports for any sd* device these days, the geometry does not come from Transcend.
Ok, good to know. I won't necessarily trust it in the future. Testing on a Fedora 12 box, if that is of interest for placing the scsi host geometry with any kernel changes:
[andrew@mythdvr flashbench]$ uname -a Linux mythdvr 2.6.31.6-166.fc12.x86_64 #1 SMP Wed Dec 9 10:46:22 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
Yes, it's old. :)
[andrew@mythdvr flashbench]$ sudo fdisk -l /dev/sdb | grep Disk Disk /dev/sdb: 31.6 GB, 31611420672 bytes Disk identifier: 0x6f20736b
[andrew@mythdvr flashbench]$ factor 31611420672 31611420672: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 13 773
This suggests that we have 10049 3MB sections, my guess is that the erase block size is actually 3 MB based on that.
Ok.
repartitioning should really have no impact on this. I don't understand what's going on with the read errors.
Thought I'd mention it in case anyone knew or saw it as a failure mode. Unless they come back, I'm not concerned.
This resuls might be clearer in --random mode for this, but 24 MB of special area seems reasonable for a large USB device, especially if it was formatted with a small cluster size.
Given the size of the drive as a multiple of 3MB, I would suggest you do another test with --erasesize=$[3*1024*1024] --blocksize=$[48 * 1024] to see if that gives clearer results.
[andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --findfat --erasesize=$[3*1024*1024] --blocksize=$[48*1024] --fat-nr=10 3MiB 32.3M/s 32.7M/s 31.6M/s 32.7M/s 33.1M/s 31.4M/s 32.9M/s 32.9M/s 31.7M/s 32.9M/s 1.5MiB 31.9M/s 32.9M/s 31.2M/s 32.9M/s 33M/s 31.3M/s 32.9M/s 32.9M/s 32.8M/s 35M/s 768KiB 32M/s 32.6M/s 31.2M/s 30.9M/s 32.7M/s 31.2M/s 32.4M/s 32.4M/s 31.4M/s 32.6M/s 384KiB 30.2M/s 30.9M/s 29.6M/s 30.8M/s 31M/s 29.6M/s 30.9M/s 30.8M/s 31.7M/s 33.9M/s 192KiB 31.7M/s 32.3M/s 30.8M/s 32.1M/s 32.5M/s 30.9M/s 32.5M/s 32.4M/s 30.9M/s 32.3M/s 96KiB 32M/s 32.8M/s 31.5M/s 32.8M/s 33M/s 31.3M/s 32.9M/s 33.1M/s 30.8M/s 33.4M/s 48KiB 28.1M/s 28.6M/s 27.6M/s 28.5M/s 29.2M/s 27.4M/s 28.8M/s 28.7M/s 27.6M/s 28.7M/s
With 48KiB blocksize, doesn't show much.
[andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --findfat --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --fat-nr=10 3MiB 32.7M/s 32.7M/s 31.5M/s 32.7M/s 32.9M/s 31.3M/s 32.8M/s 32.9M/s 32.8M/s 34.8M/s 1.5MiB 32M/s 32.9M/s 31.3M/s 32.7M/s 32.8M/s 31.2M/s 32.9M/s 32.9M/s 31.3M/s 32.9M/s 768KiB 31.9M/s 32.7M/s 31.1M/s 32.5M/s 32.6M/s 30.7M/s 32.6M/s 32.6M/s 32.3M/s 34.6M/s 384KiB 30.1M/s 31M/s 30M/s 30.7M/s 30.8M/s 29.3M/s 30.8M/s 31.2M/s 29.6M/s 31M/s 192KiB 31.4M/s 32.2M/s 30.7M/s 32M/s 32.4M/s 30.8M/s 32.2M/s 32.4M/s 31.1M/s 33.1M/s 96KiB 32.6M/s 33.1M/s 31.6M/s 33M/s 33.2M/s 31.4M/s 33.1M/s 33.3M/s 31.4M/s 33.2M/s 48KiB 29.4M/s 30.3M/s 28.9M/s 30.1M/s 30.2M/s 28.9M/s 30.3M/s 30.4M/s 27.8M/s 29.6M/s 24KiB 24.3M/s 24.8M/s 23.8M/s 24.6M/s 24.6M/s 23.1M/s 24.6M/s 24.6M/s 24M/s 24.6M/s 12KiB 18.8M/s 18.6M/s 19.3M/s 19.2M/s 18.8M/s 18.7M/s 19.3M/s 9.35M/s 5.17M/s 6.44M/s
Going smaller shows maybe a 21 or 24MiB special area, I think.
[andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb -a --blocksize=$[3*1024] --count=100 align 6442450944 pre 1.11ms on 1.59ms post 1.09ms diff 488µs align 3221225472 pre 1.03ms on 1.42ms post 1.07ms diff 377µs align 1610612736 pre 1.1ms on 1.5ms post 1.14ms diff 383µs align 805306368 pre 1.03ms on 1.42ms post 1.07ms diff 374µs align 402653184 pre 1.02ms on 1.43ms post 1.07ms diff 383µs align 201326592 pre 1.03ms on 1.42ms post 1.06ms diff 379µs align 100663296 pre 1.01ms on 1.43ms post 1.07ms diff 386µs align 50331648 pre 1.02ms on 1.42ms post 1.07ms diff 376µs align 25165824 pre 1.01ms on 1.42ms post 1.07ms diff 387µs align 12582912 pre 1.03ms on 1.16ms post 1.16ms diff 63.4µs align 6291456 pre 1.03ms on 1.15ms post 1.16ms diff 56.7µs align 3145728 pre 1.02ms on 1.27ms post 1.12ms diff 191µs align 1572864 pre 1.02ms on 1.14ms post 1.16ms diff 52.2µs align 786432 pre 1.03ms on 1.16ms post 1.16ms diff 63.4µs align 393216 pre 1.04ms on 1.13ms post 1.05ms diff 84.2µs align 196608 pre 1.11ms on 1.1ms post 1.04ms diff 26.8µs align 98304 pre 1.04ms on 1.04ms post 1.04ms diff 7.01µs align 49152 pre 1.06ms on 1.07ms post 1.07ms diff 9.39µs align 24576 pre 1.06ms on 1.32ms post 1.07ms diff 255µs align 12288 pre 1.07ms on 1.15ms post 1.06ms diff 80.3µs align 6144 pre 1.13ms on 1.07ms post 1.32ms diff -157741
A drop happens at 3MiB but there's also the drop at 24MiB. Maybe 3MiB erase block and 24MiB group?
Possible, yes. Then again, if 8 MB is the boundary, this test would show 24MB as the smallest one to be a multiple of that.
[andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=1 3MiB 33M/s 1.5MiB 34.7M/s 768KiB 34.8M/s 384KiB 33.7M/s 192KiB 33.1M/s 96KiB 32.8M/s 48KiB 28.1M/s 24KiB 23.8M/s 12KiB 17.5M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=2 3MiB 34.5M/s 1.5MiB 33.1M/s 768KiB 33.6M/s 384KiB 31.3M/s 192KiB 29.7M/s 96KiB 26.4M/s 48KiB 18.7M/s 24KiB 5.8M/s 12KiB 2.05M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=3 3MiB 34.2M/s 1.5MiB 11.2M/s 768KiB 33.2M/s 384KiB 31.9M/s 192KiB 29.7M/s 96KiB 26.5M/s 48KiB 18.1M/s 24KiB 2.66M/s 12KiB 1.36M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=4 3MiB 12.2M/s 1.5MiB 13.3M/s 768KiB 8.28M/s 384KiB 7.49M/s 192KiB 6.65M/s 96KiB 4.09M/s 48KiB 17.1M/s 24KiB 1.91M/s 12KiB 1.19M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=5 3MiB 13.5M/s 1.5MiB 6.83M/s 768KiB 8.27M/s 384KiB 9.63M/s 192KiB 4.54M/s 96KiB 3.54M/s 48KiB 3.02M/s 24KiB 2.08M/s 12KiB 831K/s
Now it's looking more like 3 open-au, 4 falls off a bit, 5 even more down to horrible SD card speeds almost. This is worse than with 8MiB erasesize results.
My interpretation is that can handle one erase-block in random access mode and three other erase blocks in linear mode. When you get to 4 total,
[andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=1 --random 3MiB 34M/s 1.5MiB 34.1M/s 768KiB 34.7M/s 384KiB 32.9M/s 192KiB 29.6M/s 96KiB 27.6M/s 48KiB 20.6M/s 24KiB 9.23M/s 12KiB 4.13M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=2 --random 3MiB 34.2M/s 1.5MiB 32.7M/s 768KiB 33M/s 384KiB 31.2M/s 192KiB 29.8M/s 96KiB 27.3M/s 48KiB 19.5M/s 24KiB 2.89M/s 12KiB 1.48M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=3 --random 3MiB 33.7M/s 1.5MiB 11.2M/s 768KiB 33.4M/s 384KiB 32.2M/s 192KiB 10.6M/s 96KiB 26.8M/s 48KiB 3.7M/s 24KiB 1.46M/s 12KiB 802K/s
Although random looks a little better with 3MiB erasesize. Maybe 2 open-au random? Still not great.
I think it can handle random writes of a size of 16 or 32kb much better than any smaller random writes. This makes sense if it uses 16kb superpages and can cache the last write: in linear mode it is able to defer the actual write until it has the full 32kb of data, while in random write mode it has to flush this cache when the next write happens.
I think when I partition this, I'll use 24MiB bounds, then if either 3 or 8 MiB is correct, it'll be aligned.
Yes, that is a good idea.
Here's some more tests with an offset:
[andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=4 --offset=$[24*1024*1024] 3MiB 17.4M/s 1.5MiB 13.4M/s 768KiB 13.2M/s 384KiB 31.4M/s 192KiB 27.9M/s 96KiB 11.3M/s 48KiB 17.1M/s 24KiB 2.54M/s 12KiB 1.34M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=4 --offset=$[25*1024*1024] 3MiB 19.5M/s 1.5MiB 10.5M/s 768KiB 33.7M/s 384KiB 32.5M/s 192KiB 30.3M/s 96KiB 26.6M/s 48KiB 13.3M/s 24KiB 1.64M/s 12KiB 1.38M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[3*1024*1024] --blocksize=$[12*1024] --open-au-nr=4 --offset=$[24*1024*1024-1*1024*1024] 3MiB 33.6M/s 1.5MiB 6.53M/s 768KiB 5.23M/s 384KiB 3.05M/s 192KiB 10.6M/s 96KiB 4.34M/s 48KiB 16.5M/s 24KiB 2.73M/s 12KiB 1.14M/s
23MiB offset looks a bit worse than 24 or 25 for larger blocks, so 24MiB is probably a erase block boundary.
Just a few quick tests with 8MiB again, for good measure:
[andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[8*1024*1024] --blocksize=$[16*1024] --open-au-nr=4 --offset=$[24*1024*1024] 8MiB 32.3M/s 4MiB 32M/s 2MiB 31.3M/s 1MiB 30.7M/s 512KiB 27.5M/s 256KiB 24.2M/s 128KiB 21.8M/s 64KiB 17.1M/s 32KiB 10.9M/s 16KiB 1.54M/s [andrew@mythdvr flashbench]$ sudo ./flashbench /dev/sdb --open-au --erasesize=$[8*1024*1024] --blocksize=$[16*1024] --open-au-nr=4 --offset=$[23*1024*1024] 8MiB 32.7M/s 4MiB 12.9M/s 2MiB 20.9M/s 1MiB 6.4M/s 512KiB 19.6M/s 256KiB 4.14M/s 128KiB 23.8M/s 64KiB 2.88M/s 32KiB 8.76M/s 16KiB 1.72M/s
24MiB definitely looking like a boundary. At the smaller blocksizes, it looks as though alignment with the erase block isn't what causes the slowness. On the bigger sizes, alignment definitely is important. Would this indicate anything in particular about the garbage collection routines? Or any other activities of the controller?
One thing I notice here is that ever other row is slow, so you get into garbage collection only sometimes in the 4*8MB test case, and that is the same for 4*3MB.
The trick that I sometimes use when finding out the erase block size is as hard as with this one is to try all sorts of boundaries. Given that the 25 MB offset is not slower than the 24 MB one for 3 MB erase blocks, I would guess that the erase size has to be larger than 3 MB. The question to look at really is how far you have to move the offset until you hit the next boundary after 24 MB.
Arnd