View Single Post
Old 05-22-2016, 12:55 AM   #274
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
I finally got around to running a speed test on the K1 internal userstore partition (shared flash drive) and another speed test on the SD card when accessed by the K1. The test has been running for some time.

I tested the SD card write and read speed while plugged into a host PC, by copying a 100MB zero-filled file. It is class 4, which means that the MINIUMUM write speed should be 4MB/second. I measured 5MB/second writes, and 4MB/second reads.

Inside the kindle, I am creating a file on /mnt/us with "dd if=/dev/zero of=/mnt/us/zero100mb.tst bs=1M count=100", to test write speed to /mnt/us. I then copy that file to /dev/null using the same parameters. I then do both steps using /mnt/mmc instead of /mnt/us.

It is taking a VERY LONG time. I used a "time" command to wrap the "dd" copies, so the log file should tell us the results. My esperience shows that writing to SD card in the K1 (and reading from it) will be a long wait.

My guess is that it is using the SD card in SPI (one-bit serial) mode, which not only explains its slow speed, but also why my SD wifi card did not work (not visible when network scanning). In SPI mode you do not supply power to the card directly. Instead, the card is powered by the serial clock, and you need to send a bunch of clocks before any data to pre-charge the power supply capacitors inside the SD card -- all part of the SD card SPI mode specification. That just adds to the startup time each time you want to communicate with the SD card. Probably not much concern when the kindle is designed to mostly sleep, except during page turns.

I will know with a high degree of certainty when this test completes (perhaps by morning?) and I can view the log file. I am not going to wait any longer -- time will tell (in the morning). It taks an awful long time to assigne a drive letter (and to eject the drive) in windows, when an SD card is installed in the K1. However, with only about 160MB of free space on internal storage, an SD card is essential for anything really useful (like an optware image file, or similar, or a collection of kindle videos for my player).

I want to copy a jffs2 (highly compressed) image file to the SD card tomorrow, and see if I can mount it. As you may know, highly compressed data can compensate for slow communication channels (like a serial interfaced SD card) quite well. If that works, I will install a root filesystem (and a swap file as well) and see if I can do gcc compiles with the aboriginal armv4l build tools, but inside the K1.

Ahh... the test finally completed.

/dev/zero to /mnt/us speed = 471KB/second.
/mnt/us to /dev/null speed = 1.1MB/second.
===> It makes sense that writing to OneNAND flash is slower than reading from it.

Now for the REAL test:
/dev/zero to /mnt/mmc = 257KB/second.
/mnt/mmc to /dev/null = 622KB/second.

Considering that I was doing software bit-bang SPI serial writes to SD card on OpenWRT a decade ago (with my own optimizations) at more than 1MB/second, this is somewhat pathetic. But it is what it is. And I used JFFS2 to speed it up back then. Perhaps once again here. However, unless things have changed, JFFS2 always does an integrity check when you mount it, and back then my SD card was only 1MB. Now I have 4MB at a fraction of the (kindle access) speed. It took minutes to mount back then. I wonder how long to mount JFFS2 on SD inside my K1. We shall see. Perhaps there is a way to NOT make it do that check on every mount -- but is that a good idea?

So, a 4MB/second SD card runs at about 5-percent of its rated speed when mounted in a K1. However, even the internal OneNAND flash memory is not all that much faster, with its SOFTWARE write wear levelling and sector translation overhead. So in that case, I guess it is safer to stick the swap file on the SD card (much easier to replace than the internal OneNAND flash chip)...

Last edited by geekmaster; 05-22-2016 at 01:01 AM.
geekmaster is offline   Reply With Quote