Reply
Thread Tools
Posts: 209 | Thanked: 31 times | Joined on Oct 2006
#1
Hi,

i've bought a N770 (plus 2GB Kingston mmcmobile card) a few days ago.

My setup:
  • 2GB kernel (zImage-su-18-200625-2gb-mmcplus52Mhz)
  • bootmenu (booting from mmc2 ext2 partition)

Now the startup of the device is much faster!

But when i try to download larger files over wlan (with wget)
the download starts with ca. 600KB/s and slowsdown to ca. 200KB/s and
my CPU usage (xterm top) increases to ca. 100%. Then my system begins to
hang sometimes.
"Top" shows me that the service "mmcqd" is responsible to the high cpu usage!
So it seems that the download slowsdown when chached writes are synced to the mmc.

So I tested the read/write speed of my card.

Code:
time dd if=/dev/mmcblk0 of=/dev/null bs=8192 count=10240
10240+0 records in
10240+0 records out
real 0m 15.63s
user 0m 0.02s
sys 0m 2.25s

Code:
time dd if=/dev/zero of=zero-file bs=1024 count=10240; time sync
10240+0 records in
10240+0 records out
real 0m 0.62s
user 0m 0.03s
sys 0m 0.57s
real 0m 26.44s
user 0m 0.00s
sys 0m 0.01s

Result:
  • Read ca. 5200KB/sec (80MB in 16sec)
  • Write ca. 380KB/sec (10MB in 27sec)

Is that normal??? such a slow write speed?
Can anyone confirm this?


Greetings from Germany
N770-Freak
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#2
Noticed this too. Exactly same behaviour. Would be interesting to test it directly with raw device (will destroy data): time dd if=/dev/zero of=/dev/mmcblk0pX bs=1024 count=x. If this is considerably faster the linux file/buffer cache is probably the problem. If not, it can be something in mmc driver. Would be also interesting to test 2gb kernel without high-speed patches if it is same, but I guess it will be the same. There are no suspicious errors in kernel log (dmesg output) except ocassional unexpected interrupt or something similar so I guess the mmc driver works fine and there are no retries or timeouts while writing (caused by higher speed) that could slow it down.
 
Posts: 450 | Thanked: 16 times | Joined on Mar 2006
#3
N770-Freak's initial thread would seem to indicate that he/she is accessing and using the 2GB Kingston Mobile card in the 770 without first attaining support for the card by flashing zImage-su-18-200627. Did the flashing of zImage-su-a8-200625-2gb-mmcplus52Mhz to gain a higher MMC bus speed also somehow accomplish the attaining of access provided by the 200627?
 
Posts: 209 | Thanked: 31 times | Joined on Oct 2006
#4
he/she
He, please

Did the flashing of zImage-su-a8-200625-2gb-mmcplus52Mhz to gain a higher MMC bus speed also somehow accomplish the attaining of access provided by the 200627?
The "zImage-su-a8-200625-2gb-mmcplus52Mhz" is a kernel image with 2GB and 52Mhz support (like the file name says). I don't really know what this kernel image contains, but i think that this image is only a compiled kernel. So it doesn't matter what kernel was installed before (it is a complete replace of the old one).


Would be interesting to test it directly with raw device (will destroy data): time dd if=/dev/zero of=/dev/mmcblk0pX bs=1024 count=x
I created a new partition at the end of the mmc (100MB ext2) and tested this...
Code:
time dd if=/dev/zero of=/dev/mmcblk0p3 bs=1024 count=10240
10240+0 records in
10240+0 records out
real 0m 34.30s
user 0m 0.02s
sys 0m 0.88s

300KB/sec write speed

Would be also interesting to test 2gb kernel without high-speed patches if it is same, but I guess it will be the same.
I've flashed my device with the "zImage-su-18-200627"...

Code:
time dd if=/dev/mmcblk0 of=/dev/null bs=8192 count=10240
10240+0 records in
10240+0 records out
real 0m 58.96s
user 0m 0.03s
sys 0m 2.21s

1400KB/sec read speed

Code:
time dd if=/dev/zero of=outputf bs=1024 count=10240; time sync
10240+0 records in
10240+0 records out
real 0m 0.66s
user 0m 0.03s
sys 0m 0.54s
real 0m 31.63s
user 0m 0.00s
sys 0m 0.03s

320KB/sec write speed

Code:
time dd if=/dev/zero of=/dev/mmcblk0p3 bs=1024 count=10240
10240+0 records in
10240+0 records out
real 0m 39.58s
user 0m 0.05s
sys 0m 0.78s

260KB/sec write speed

Btw. i rounded all the values.


Hope that helps someone (perhaps fanoush ) to find the real source of the problem (and solves it).

Greetings
N770-Freak
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#5
Hello. The problem seems to be that MMC supports so called multiblock read and write command but current kernel support only multiblock read but not write. There is a patch that enables writing too http://www.spinics.net/lists/arm-kernel/msg35748.html but there was a reason for disabling that. On some MMC controllers it can cause data corruption. Maybe OMAP inside N770 works fine (see also http://www.spinics.net/lists/arm-kernel/msg35999.html ) but it is definitely untested.

Anyone wants to try kernel with multiblock writes enabled ? You can find it here http://fanoush.webpark.cz/maemo/#mmcplus below the high-speed one. It works for me and write speed is ~2MB/s but it may bite you in the future (same as high speed mode) so don't try it if you like your data on MMC and use N770 for something mission critical.

You can measure write speed like this

sync ; date ; dd if=/dev/zero of=/path/to/mmc/test bs=8192 count=5000 ; sync ; date

My test (system booted from MMC):

Code:
Nokia770-26:~# sync ; date ; dd if=/dev/zero of=/test bs=8192 count=5000 ; sync ; date
Mon Oct 30 08:33:09 CET 2006
5000+0 records in
5000+0 records out
Mon Oct 30 08:33:39 CET 2006
Nokia770-26:~#
40 MB in 20 seconds :-)
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#6
Oh, sorry it seems to be 30 seconds in the test above, I think I got 20 seconds yesterday.
 
Posts: 209 | Thanked: 31 times | Joined on Oct 2006
#7
Tanks for this patch!

I've flashed this new kernel a few minutes ago...
Got 40MB in 34 secs => ca. 1100KB/sec

Hope that my mmc controller can handle this without data corruption


Greetings...
N770-Freak
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#8
It probably depends a lot on the filesystem i.e. you need to have continuous free blocks to use the multiblock write with big gains. Bus some gain is constant. Basic MMC block is 512bytes and ext2 filesystem uses 1024 or bigger blocks so at least such blocks can be written at once.
 
Posts: 286 | Thanked: 259 times | Joined on Jan 2006 @ Cambridge, England
#9
Hi

Does this only become an issue if writing a lot of data?

If you run the OS from the mmc card and don't have large file transfers, is the speed acceptable?

Cheers
Rich
 

The Following User Says Thank You to richie For This Useful Post:
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#10
Well, most usage is just reading so yes, mostly it is acceptable and hard to notice.

Slow writes may hurt virtual memory performace (i.e. when swapping) and when downloading from fast network or moving data via USB. Both speeds (wlan and USB) are slightly higher that default MMC write speed. It probably doesn't matter at all when you write few kilobytes or even megabytes infrequently since there is some cache. Of course it depends on amount of free memory which is unfortunately permanently low on N770. Once there is no free memory for more data when writing continuously it slows down to crawl (i.e. 200-300KB/s) and system may become low on memory (and a bit ustable and slow) because all memory is occupied by data which needs to be written.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 16:09.