SD Card performance in R-Pi onboard slot


290 posts   Page 3 of 12   1, 2, 3, 4, 5, 6 ... 12
by lb » Mon Jun 11, 2012 11:20 am
Larry_Adlard wrote:Tales of woe. It's been a long day and you can tell by the time of this post that we're coming to the end of it.

...

I'm out of my depth guys. I really want to develop Python for the kids and messing with the system is stopping me. With the original kernel the Class 10 is faster but there's plenty of performance still to be wrung from the Class 4 card. I'm not complaining, this is the development phase but there a way to go before the kids can plug it in and start programming.


The Raspberry Pi software stack is still in a beta stage, for the better or worse. There's a lot going on at the moment. Just wait a month or so and you should have a much better experience.
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by dom » Mon Jun 11, 2012 11:25 am
selsinork wrote:Strongly suggest that you send a pull request to dom and see if these can get included in the main kernel.


It might be better to communicate with Chris Boot (https://github.com/bootc). He is working on an upstreamable version of the kernel which is likely to be the one future tree R-Pi uses
(and is used in OpenELEC testbuilds).
I won't directly take a pull request, but I'm watching the work closely, and if Naren agrees with the changes, they will be pushed soon.

Note: Like with overclocking, it is very easy to improve a specific user's performance in a specific benchmark. Making sure that is reliable for everyone is the difficult bit.
I'd like to see as many users as possible testing lb's kernel before we take the changes. We also need to be very sure we're not running cards out of spec.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by texy » Mon Jun 11, 2012 11:34 am
In order to get as much coverage, and release it to the masses for bulk testing (if thats what you want), maybe it would be worth giving clear instructions on how to measure performance before and after the change, and step by step instructions of the changes needed, and where to get the image, etc.
I realise its (probably) all in this thread, but think of us linux newbie's ;) .
Thanks for all the hard work - I,m sure many of us will really appreciate it !

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2480
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by selsinork » Mon Jun 11, 2012 12:12 pm
dom wrote:It might be better to communicate with Chris Boot

I've already pointed it out in an irc channel where both Chris and Simon hang out and I've been following their work. Indeed the only thing stopping me using their upstream kernels has been sd card issues.

dom wrote:I won't directly take a pull request, but I'm watching the work closely, and if Naren agrees with the changes, they will be pushed soon.

That you're watching is good enough :)

Understood on the reliability/overclocking issues. What we need is enough people to test that this works on a range of cards.

For my part, I've just finished testing my smallish set of cards, covering class 4,6,10 and one with UHS-1. Several of which have had problems with various combinations of patches. They now all work. Some variation in performance (the class10/uhs-1 is the slowest!), but all show marked improvement in the range of 3x to 4x. None of the mmc0: timeout.... style errors that were present during boot even for working cards previously.

The really noticeable change is boot time. I'm getting power on to login prompt at around 7 seconds which is fast enough that I don't even see the Pi logo.
Posts: 151
Joined: Mon Apr 16, 2012 8:31 am
by texy » Mon Jun 11, 2012 12:25 pm
selsinork wrote:The really noticeable change is boot time. I'm getting power on to login prompt at around 7 seconds which is fast enough that I don't even see the Pi logo.


WOW - even on a class 4 card? If that is the case, is there even any point of having anything faster?

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2480
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by asb » Mon Jun 11, 2012 12:27 pm
You might consider sending a cleaned up patchset to the linux-rpi-kernel mailing list for review.

http://lists.infradead.org/mailman/list ... rpi-kernel
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 800
Joined: Fri Sep 16, 2011 7:16 pm
by Larry_Adlard » Mon Jun 11, 2012 12:29 pm
asb wrote:
Larry_Adlard wrote:Now comes the BUT. When you load Xwindows (startx) the mouse and keyboard don't work any more.


I suspect the kernel is incompatible with your modules. Verify by seeing if you get an error with `sudo modprobe evdev`.


Thanks for that.

I ran sudo modprobe evdev and it returns nothing.

I know the system detects the mouse and keyboard during boot because a message is displayed. I believe the boot messages are stored in a file somewhere but I don't know where. Perhaps in passing someone can point me at the right directory. Clearly the keyboard is working before startx.

I've now got a correction to my earlier statement. I'm using a radio keyboard and mouse set, to save a USB slot and power. It goes to sleep after a while to save the battery. If you immediately start to use it after Xwindows loads, then it is working, so it isn't as bad as I thought it was. As long as I use the mouse immediately it works normally.

Just as an aside the voltage on the test points varies between 5.00 - 5.15 volts.

I'm going to try 20120611 in a minute or two.
User avatar
Posts: 53
Joined: Tue May 29, 2012 8:07 pm
Location: Bradford, West Yorkshire, UK
by AndrewS » Mon Jun 11, 2012 12:40 pm
Larry_Adlard wrote:I know the system detects the mouse and keyboard during boot because a message is displayed. I believe the boot messages are stored in a file somewhere but I don't know where.

Have a look in /var/log/ or at the output of the dmesg command.
User avatar
Posts: 3626
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by Larry_Adlard » Mon Jun 11, 2012 1:00 pm
Kernel 20120611 is a step too far for my Class 4 card. All I get is error 110 and 84. So I'm reverting to 20120610.

The Class 10 card only gets error 110, It doesn't report error 84.

My other work is backing up so I'm afraid that's it for today.

BTW. Can someone better connected with the development team find out what SD card they tested? I don't mind being restricted to something that is guaranteed to work.
User avatar
Posts: 53
Joined: Tue May 29, 2012 8:07 pm
Location: Bradford, West Yorkshire, UK
by Larry_Adlard » Mon Jun 11, 2012 1:02 pm
AndrewS wrote:
Larry_Adlard wrote:I know the system detects the mouse and keyboard during boot because a message is displayed. I believe the boot messages are stored in a file somewhere but I don't know where.

Have a look in /var/log/ or at the output of the dmesg command.


Thanks. Will do.

I've been using linux for a few years but never looked under the hood. I know this might be a pain for some but I'm learning a lot, fast.
User avatar
Posts: 53
Joined: Tue May 29, 2012 8:07 pm
Location: Bradford, West Yorkshire, UK
by lb » Mon Jun 11, 2012 1:06 pm
selsinork wrote:For my part, I've just finished testing my smallish set of cards, covering class 4,6,10 and one with UHS-1. Several of which have had problems with various combinations of patches. They now all work. Some variation in performance (the class10/uhs-1 is the slowest!), but all show marked improvement in the range of 3x to 4x. None of the mmc0: timeout.... style errors that were present during boot even for working cards previously.


Awesome! That is really great news. I have a good selection of older cards (even some *ancient* MMC cards), but not many newer cards, and no UHS-1 card. But all of them work. I think we can pretty safely assume the card compatibility and performance issues are gone for good now.

Seems odd that the UHS-1 card performs badly. What does "cat /sys/devices/platform/bcm2708_sdhci.0/status" report for it?

texy wrote:WOW - even on a class 4 card? If that is the case, is there even any point of having anything faster?


The class indicates write performance. Generally, reads are pretty fast even among bad and slow cards. Higher classes indicates better write speed*.

(*Caveat: the class refers to sequential write performance. However, for an OS installation that has many small files, random write performance is more important, and most SD cards suck really badly at this, independent of class)

Larry_Adlard wrote:Kernel 20120611 is a step too far for my Class 4 card. All I get is error 110 and 84. So I'm reverting to 20120610.

The Class 10 card only gets error 110, It doesn't report error 84.


Have you reduced the eMMC clock to 50 MHz with "init_emmc_clock=50000000" in config.txt? This is absolutely necessary!
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by timgiles » Mon Jun 11, 2012 1:35 pm
Just as an aside - I have not had a chance to play with anything other than the latest RaspBMC build. My Sandisk 8Gb Extreme Pro 95MB/s is the fastest card I have flashed. Perceptively it runs 3 or 4 times quicker than a 32Gb Sandisk 30MB/s card. Ill try and find some time to test both and a selection of other non UHS-I cards I have (mostly Sandisk).

So the fastest card 'feels' life the UHS-I card.

Thanks for your time and effort.
Posts: 101
Joined: Thu Jan 12, 2012 8:58 am
by Alfadaz » Mon Jun 11, 2012 1:53 pm
Would this kernal work with the Raspbmc build?

Daz
Posts: 51
Joined: Tue May 22, 2012 10:18 am
Location: Cwmbran, S.Wales
by Larry_Adlard » Mon Jun 11, 2012 1:57 pm
lb wrote:
Larry_Adlard wrote:Kernel 20120611 is a step too far for my Class 4 card. All I get is error 110 and 84. So I'm reverting to 20120610.

The Class 10 card only gets error 110, It doesn't report error 84.


Have you reduced the eMMC clock to 50 MHz with "init_emmc_clock=50000000" in config.txt? This is absolutely necessary!


Confirm that "init_emmc_clock=50000000" is now permanently part of my config.txt at the moment, across the cards I'm testing.
User avatar
Posts: 53
Joined: Tue May 29, 2012 8:07 pm
Location: Bradford, West Yorkshire, UK
by selsinork » Mon Jun 11, 2012 3:52 pm
lb wrote:Seems odd that the UHS-1 card performs badly. What does "cat /sys/devices/platform/bcm2708_sdhci.0/status" report for it?


present: yes
power: on
clock: 50000000 Hz
dma: on (0 waits)

I'll also say that it performs badly in the onboard slot on my laptop and in a usb card reader too, so it's nothing to do with your changes. It's just not a very good card for the Pi, perhaps they optimized it for UHS-1 modes who knows.
The real point is that it's a known problematic card, so it's a good test.
Posts: 151
Joined: Mon Apr 16, 2012 8:31 am
by AndrewS » Mon Jun 11, 2012 4:35 pm
Larry_Adlard wrote:BTW. Can someone better connected with the development team find out what SD card they tested? I don't mind being restricted to something that is guaranteed to work.

AFAIK the dev team have made no recommendations re: SD cards, but the community has done lots of testing http://elinux.org/RPi_VerifiedPeripherals#SD_cards :D
User avatar
Posts: 3626
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by dom » Mon Jun 11, 2012 4:53 pm
AndrewS wrote:AFAIK the dev team have made no recommendations re: SD cards, but the community has done lots of testing http://elinux.org/RPi_VerifiedPeripherals#SD_cards :D

The most common card used around here is a Sandisk Ultra class 4 2G. Although the 4G and 8G are also used and work well.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by asb » Mon Jun 11, 2012 5:18 pm
dom wrote:The most common card used around here is a Sandisk Ultra class 4 2G. Although the 4G and 8G are also used and work well.


At the lab we've bought and used a *lot* of Transcend Class 4 4GB. http://www.ebuyer.com/350697-transcend- ... -ts4gsdhc4
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 800
Joined: Fri Sep 16, 2011 7:16 pm
by Jim Manley » Mon Jun 11, 2012 5:21 pm
Larry_Adlard wrote:Now comes the BUT. When you load Xwindows (startx) the mouse and keyboard don't work any more

You also need to update /lib/modules/3.1.9+ on the Pi when you rev the kernel. They're at:
https://github.com/raspberrypi/firmware ... er/modules
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!
User avatar
Posts: 1358
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, USA
by Larry_Adlard » Mon Jun 11, 2012 6:10 pm
Jim Manley wrote:
Larry_Adlard wrote:Now comes the BUT. When you load Xwindows (startx) the mouse and keyboard don't work any more

You also need to update /lib/modules/3.1.9+ on the Pi when you rev the kernel. They're at:
https://github.com/raspberrypi/firmware ... er/modules


Thanks. That exactly explains the following:

kernel-20120610
The problem with the mouse and keyboard is back - permanently.
During boot the device is correctly identified with USB device id and manufacturer.

A few lines later the system displays:-
joydev disagrees about version of symbol table lookup
evdev disagrees about version of symbol table lookup

once the system is up the keyboard continues to operate, i.e. you can login.

sudo modprobe evdev reports
FATAL: error inserting evdev (lib/modules/3.1.9+/kernel/drivers/input/evdev.ko) invalid module format.
User avatar
Posts: 53
Joined: Tue May 29, 2012 8:07 pm
Location: Bradford, West Yorkshire, UK
by selsinork » Mon Jun 11, 2012 6:26 pm
If anyone is interested, I've merged lb's changes into bootc's 3.2.19, results available here https://github.com/selsinork/linux

I know things will change, the patches will get cleaned up etc. but this is just so useful now that I couldn't resist :)
Posts: 151
Joined: Mon Apr 16, 2012 8:31 am
by selsinork » Mon Jun 11, 2012 6:31 pm
AndrewS wrote:AFAIK the dev team have made no recommendations re: SD cards, but the community has done lots of testing http://elinux.org/RPi_VerifiedPeripherals#SD_cards :D


It could be interesting to see how many of the problem cards from the list start working with lb's code
Posts: 151
Joined: Mon Apr 16, 2012 8:31 am
by lb » Mon Jun 11, 2012 6:48 pm
selsinork wrote:If anyone is interested, I've merged lb's changes into bootc's 3.2.19, results available here https://github.com/selsinork/linux

I know things will change, the patches will get cleaned up etc. but this is just so useful now that I couldn't resist :)


Bad timing, I just rebased and cleaned up the whole mess: https://github.com/grigorig/rpi-linux/c ... rf-cleanup
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by texy » Mon Jun 11, 2012 7:21 pm
...yes but us newbies only need the kernel.img file ;)

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2480
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by selsinork » Mon Jun 11, 2012 9:12 pm
lb wrote:Bad timing, I just rebased and cleaned up the whole mess: https://github.com/grigorig/rpi-linux/c ... rf-cleanup


Not to worry, it was an interesting excersise and I learned a lot more git stuff while doing it :)
Posts: 151
Joined: Mon Apr 16, 2012 8:31 am