yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] RyanZA:
It does the same thing as mimocan's lag fix, which does make everything smoother. So yes, it does affect performance.

# busybox /sbin/modprobe loop

busybox /sbin/modprobe loop

modprobe: chdir(2.6.29): No such file or directory

Anybody have any idea on this? OP, some help on the /dev/loop devices? :D
[Galaxy S I9000 Android Development] steffe.jst:
I might be missing something here but...

Would I not get similar/better result if I moved these files (/dbdata/databases, /cache (browser & market cache -> /cache)) to my already existing ext4 partition on my external SD card?

This is a great find however, and it would definitely be an idea for Samsung to include this in future firmwares so that external SD cards aren't necessary for lag fixes. Or they could simply sort out their file system all in all >=(
[Galaxy S I9000 Android Development] AJerman:
That's a very nice score. That's the only one I've seen beat mine so far (not that I've really looked, a few probably do).

So if I read your instructions right, you're doing the file on NAND? We've been talking about that too, my only concern was lack of space. Planning a few things for in the future that would take advantage of it though.

I agree with a few others though, ext2 is a very bad idea on a phone. ext2 is very prone to losing data if you have an unclean shutdown. The score is nice, but I would be careful using an ext2 partition.
[Galaxy S I9000 Android Development] Archer13:
I found /dev/block/loop1 .. loop7. But have no idea yet if it working :)
[Galaxy S I9000 Android Development] sionyboy:
So, if I understand correctly, the lag/stalling problem on the SGS looks to be the fault of the proprietary FAT32-based file system that Samsung are using, as opposed to 'slow nand'?

Do other Androids use EXT for their file systems, or are Samsung just using immature drivers/firmware for their Android line-up?
[Galaxy S I9000 Android Development] gilsken:
I'm not sure but it seems that this fix is already mentionned by some french people and after few days, this fix does not resolve the lag but only increases drasmatically your quadrant's score. If somebody could check this, thanks.

for the french, the link is here:

hxxp://forum.frandroid.com/forum/viewtopic.php?id=19071
[Galaxy S I9000 Android Development] steffe.jst:
+1.

Either answer means Samsung deserves a proper facepalm or two though.
[Galaxy S I9000 Android Development] RyanZA:
Nope, not doing the file on NAND.

/dev/block/mmcblk0p2 1.9G 576.1M 1.3G 30% /data

/dev/block/mmcblk0p2 /data rfs rw,nosuid,nodev,vfat,llw,check=no,gid/uid/rwx,ioc

harset=utf8 0 0

Samsung by default have partitioned 2GB of the internal SD to a RFS drive, where all applications and data is stored. This fix creates a big (I'm trying with 500mb now) file inside this partition, and then creating a virtual EXT2 inside that file. This skips the overhead of the RFS filesystem, which seems to be the big killer for SGS performance.

And yes, other android systems don't use stupid stuff like RFS, which is why they don't have those occasional random lags while RFS blocks everything to do consistency checks and other junk. (This was all speculation based on the evidence so far.)
[Galaxy S I9000 Android Development] kalpik:
Erm.. Why doesn't Samsung do away with this stupid rfs? :s
[Galaxy S I9000 Android Development] myslee_ovi:
mmh... isn't it possible to modify the PIT to bypass/fix this problem native?
[Galaxy S I9000 Android Development] RyanZA:
Man, why do people keep stuff like this to themselves?! ;)
[Galaxy S I9000 Android Development] jim_panse:
can we do this as an ext4? Because ext2 semms to be not safe. Should be the same procedure?
[Galaxy S I9000 Android Development] ivanmmj:
Are you having any problems when you mount the SD card on a computer?

This concerns me.

What we really need to figure out is for a way to have the RFS partitions formatted to EXT4 and still have the bootloader boot the phone...
[Galaxy S I9000 Android Development] android53:
Can anyone please release a tutorial or script so we can test this for ourselves? i doubt there is any possibility of bricking our phones as the bootloader is write protected...
[Galaxy S I9000 Android Development] ykkfive:
it seems that many of u r not too sure what to do, or it's my fault due to writing the so called how to in a hurry.

ok, let me explain a bit more

(appended to my 1st post)
[Galaxy S I9000 Android Development] RyanZA:
Mmm.. I'm only seeing 1700 quadrant. Lemmi run through it again in case one of the options somewhere did it.
[Galaxy S I9000 Android Development] Archer13:
Quadrant: 2245

Benchmark filesystem total score: ~260. Was 25-50 on RFS.

Playing with buttons and icons to understand if I like it...
[Galaxy S I9000 Android Development] jim_panse:
can this procedure done on the phone or do i need a pc? Because im on the train and i want to try it ;)
[Galaxy S I9000 Android Development] Archer13:
I did it on my phone with busybox.
[Galaxy S I9000 Android Development] ykkfive:
right, it is totally computerLESS :D
[Galaxy S I9000 Android Development] AlessandroIT:
So if someone succeded, please post a little step by step :)

it would be great :)

Oh and ofcourse, thanks :)
[Galaxy S I9000 Android Development] BackfireNL:
Omg! how obvious!... the lag was due to the RFS file system... We need to mod the partitions so we can flash a kernel that allows us to use EXT2/3/4 natively for al the partitions!

Please if someone from samsung reads this! Please fix this! Because for devs this should be a relatively easy trick!

And could someone write a proper tutorial for this! and i will buy him a beer!
[Galaxy S I9000 Android Development] mark99uk:
I'm assuming the effectiveness of this fix is similar to the mimocam fix? Because I find that that still has lag issues such as a 5 second black screen when loading handcent occasionally for example, or when clicking the home button. Therefore if this fix works in the same way, it still isn't a complete fic and will still leave some lag. :-(
[Galaxy S I9000 Android Development] RyanZA:
Yah, it is very similar to the mimocam fix. Mimocan/this fix does fix the IO problems that the SGS has when loading applications. It won't affect other lags, such as badly coded apps and homescreen widgets (like the daily briefing widget, only fix for that widget is to remove it from your homescreen ;) )
[Galaxy S I9000 Android Development] ykkfive:
some apps put their data/cache in /sdcard, eg RMAP, layar. so, even if u apply this trick or others, u wont notice any improvements. as a result, u have to customize them and point them to where u want to
[Galaxy S I9000 Android Development] ykkfive:
actually, b4 i heard about data2sd, i've already moved those files into /cache & /dbdata already. after that, when i saw data2sd, i thought maybe i can apply it locally/internally, so after googling i found a way to do this
[Galaxy S I9000 Android Development] RyanZA:
Why are you making your ext2fs in /dbdata ?

/dev/block/stl10 127.2M 1.9M 125.4M 1% /dbdata

It is only 125mb big!

/data is 2gb big

/dev/block/mmcblk0p2 1.9G 1.0G 860.0M 55% /data

I made an ext2fs in /data now with noatime,nodiratime,errors=continue and I just got 2178 in quadrant! :D The ext2 file is 1GB big, so there won't be any space issues. If you leave it in /dbdata you will have lots of space issues.

I am putting together a script now that should be able to run on any firmware with no data loss and give quadrant scores of 2k+, and be completely reversible. :D
[Galaxy S I9000 Android Development] c010:
Nice work ykk_five! i guess not all of us are linux savy. A step by step + script provided would be much appreciated. Hope you are able to do so. thanks a lot.
[Galaxy S I9000 Android Development] SlimJ87D:
QUADRANT SCORES don't mean as much as we all think. If ur not seeing increases in pie calculation, linepackbor neocore also than its all just placebo. Take it from all my friends vibrants that score in the 2K after i performed simlar fixes for them.
[Galaxy S I9000 Android Development] ykkfive:
the reason was, stl10 is much faster than mmcblk0p2, and that i don have too many apps installed (so far). so, this post/trick serves as a bait (can i say it this way?) to make expertises to fine tune it or replace it with a better solution
[Galaxy S I9000 Android Development] putkte:
What busybox version and what kernel are you using?

Because i dont have mkfs.ext2/3 commands. So just wonderin. If someone could be so nice to compile thise for samsung.

I have mimosa kernel and busybox version 1.15.3
[Galaxy S I9000 Android Development] achio1115:
Is it gonna take long? If not, I'm gonna go make some coffee, lol. (It's 1:42am over here...) :D
[Galaxy S I9000 Android Development] jim_panse:
This would be great, ryan!!!
[Galaxy S I9000 Android Development] ykkfive:
i'm sorry, but i'm sure there will be a better script/guide very soon by other experts
[Galaxy S I9000 Android Development] ykkfive:
mine is 1.16.1
[Galaxy S I9000 Android Development] ykkfive:
i see what u mean, but for me, i can only capable of doing this (fine tunning IO) at the moment
[Galaxy S I9000 Android Development] RyanZA:
Okay, so here is a little script you can run to test this out! Couple notes:

1. Make sure you don't reboot your device or run out of power or anything while running through this!

2. This version of the script will not survive through a reboot - it is just for looking at the big benchmark number! ;)

3. When you're finished, your device will be exactly back to how it started, as long as you don't reboot half way through.

Run this first - it will take a long time as it creates the 1GB data file.

This will only need to be run once, and will persist through reboots.

busybox dd if=/dev/zero of=/data/linux.ex2 bs=1024 count=1048576
busybox mknod /dev/loop0 b 7 0
busybox losetup /dev/loop0 /data/linux.ex2
busybox mkfs.ext2 /dev/loop0
mkdir /data/ext2data

Next step: this will mount the ext2 filesystem, make a copy of your current data, and then use the ext2 filesystem for data.

mount -t ext2 -o noatime,nodiratime,errors=continue /dev/loop0 /data/ext2data
busybox cp -rp /data/data /data/ext2data/
busybox mv /data/data /data/data.bak
busybox ln -s /data/ext2data/data /data/data

At this point you can run quadrant benchmark, and should see a 2k+ number! woohoo! :D

Do not reboot or stop at this point, or you will have to reflash your firmware!

When you are finished with the benchmark, run the following to reset your device back to how it started.

busybox rm /data/data
busybox mv /data/data.bak /data/data
busybox umount /data/ext2data
busybox losetup -d /dev/loop0
busybox rm /data/linux.ex2

I tested this on my phone and it works alright, but obviously something could probably go wrong on your device! Make sure your data is backed up before doing this, and be prepared to reflash your firmware if everything explodes! :D
[Galaxy S I9000 Android Development] RyanZA:
These are 2 completely separate issues!

Take your PC for instance - if you have an old 5200rpm IDE drive and you run a pi calculation benchmark, you won't see any different results if you put in a 15000 RPM super drive. However, when you benchmark level loading time in a game, the 15000 RPM drive will blow away the 5200rpm drive.

That is what we are doing here - increasing loading speed for applications! ie. Opening up that game from a cold start is going to go quicker after these improvements. :D

SGS CPU is already the best there is, anyway. Code up a pi calculation benchmark in pure C, where the JIT won't make a difference, and we'd probably be way on top. (Not sure about this one.)
[Galaxy S I9000 Android Development] ykkfive:
try databases also, RyanZA
[Galaxy S I9000 Android Development] c010:
is there any impact if i am currently running mimocan fix?
[Galaxy S I9000 Android Development] RyanZA:
Don't need database for the quadrant benchmark, since it's giving me 2k+ without that. ;)

I'll put together a one click solution for this stuff, and move over as much as possible.

I'm guessing:

/data/data

/data/app

/data/app-private

/data/dalvik-cache

/data/log

/dbdata/databases

Anything missing?
[Galaxy S I9000 Android Development] bub181:
What were the Samsung developers thinking when they made this decision? Why couldn't they just use the same file system as in the desire or nexus one?
[Galaxy S I9000 Android Development] ykkfive:
app-private and log are empty or only occupy limited space

also, u may separate web cache from the about if u want to, for ease of management

plus, the files under /cache
[Galaxy S I9000 Android Development] RyanZA:
I think the script would have to be altered if you are running mimocan fix... yeah probably.

In the mounting stage:

mount -t ext2 -o noatime,nodiratime,errors=continue /dev/loop0 /data/ext2data
busybox cp -rp /data/data /data/ext2data/
busybox mv /data/data /data/data.bak
busybox ln -s /data/ext2data/data /data/data

If you are using mimocan, it would instead be this:

mount -t ext2 -o noatime,nodiratime,errors=continue /dev/loop0 /data/ext2data
busybox cp -rp /disk/data /data/ext2data/
busybox rm /data/data
busybox ln -s /data/ext2data/data /data/data

and then to clean up:

busybox rm /data/data
busybox ln -s /disk/data /data/data
busybox umount /data/ext2data
busybox losetup -d /dev/loop0
busybox rm /data/linux.ex2

I haven't tested this one though! Might not work! (But it should ;) )
[Galaxy S I9000 Android Development] RyanZA:
stl10 does not seem to be faster than mmcblk0p2 for some reason. (Well, it is 2100 for /data vs 2200 for /dbdata) Which is very good news! :D Obviously 200mb for all application data would not be enough for most people, but 1GB-2GB is more than enough, with almost identical speed! (According to Quadrant anyway)

So good news all around! :D
[Galaxy S I9000 Android Development] c010:
noted. why do you need to reset it if this solution is working fine? do you mean that after we applied this solution and reboot the phone, it will brick the phone? sorry to ask this silly question, just wanna make sure this solution can be a permanent solution and to replace mimocan.
[Galaxy S I9000 Android Development] Archer13:
I think /dbdata is already fast enough. No need for move, at least for the first release. May be in the future, after some tests.
[Galaxy S I9000 Android Development] RyanZA:
/dbdata isn't fast enough! It is also using the RFS filesystem! That is the whole problem! ;)
[Galaxy S I9000 Android Development] RyanZA:
The phone won't boot up, and you will have to reflash it with Odin! So yeah, "brick". Make sure you follow the cleanup step after you're done testing! This is just a demo of what the actual fix could do for your phone. ;)
[Galaxy S I9000 Android Development] Archer13:
If you move it all together - you can't compare :) The first lag fix was on /dbdata, mainly because of big difference in speed between /dbdata and /data.
[Galaxy S I9000 Android Development] ykkfive:
my results are different from urs (5 aug)

# dd if=/dev/zero of=/dbdata/test1 bs=1024 count=10000

10000+0 records in

10000+0 records out

10240000 bytes transferred in 2.192 secs (4671532 bytes/sec)

# dd if=/dev/zero of=/data/test1 bs=1024 count=10000

10000+0 records in

10000+0 records out

10240000 bytes transferred in 16.013 secs (639480 bytes/sec)
[Galaxy S I9000 Android Development] raspdeep:
omg.. im getting 2544 with this tweak.. crazy fast.. thanks for tweak OP.. this works
[Galaxy S I9000 Android Development] ykkfive:
well, u can play with it day to day

i'm using this tricks for a few days already
[Galaxy S I9000 Android Development] ykkfive:
2544? really good, rite?
[Galaxy S I9000 Android Development] c010:
meaning as long as you dont reboot your phone, it should be fine right ? ;)
[Galaxy S I9000 Android Development] ykkfive:
no, i remount them at boot time via script as i mentioned b4 by replacing playlogos1
[Galaxy S I9000 Android Development] RyanZA:
Hoho, you are doing your /data/test1 write directly to the RFS drive! If you make an EXT2 inside /data, then this is what you see!

RFS:

dd if=/dev/zero of=/data/test1 bs=1024 count=10000

10000+0 records in

10000+0 records out

10240000 bytes transferred in 2.591 secs (3952142 bytes/sec)

EXT2 inside RFS:

dd if=/dev/zero of=/data/ext2data/test1 bs=1024 count=10000

10000+0 records in

10000+0 records out

10240000 bytes transferred in 0.782 secs (13094629 bytes/sec)

Unbelievable? ;)
[Galaxy S I9000 Android Development] RyanZA:
For my small test script, yeah. For a proper fix using this method like ykk_five has done, then no. I'll start work on a real fix and hopefully have it all going tomorrow.

Has anybody tried the demo and confirmed that they are getting good scores using it? I'd like to know if it isn't just my phone somehow. ;)
[Galaxy S I9000 Android Development] ykkfive:
yes, i've tested with ext2 under /data, for me, it's not very fast though
[Galaxy S I9000 Android Development] ykkfive:
u know the playlogos1 thing, rite?

1 more thing, if u wanna play safe, ext3 is natively supported
[Galaxy S I9000 Android Development] RyanZA:
ext3 is gonna be a lot slower, I think, but I'll test.

What seems to be causing the huge speed increases is this:

-o noatime,nodiratime,errors=continue

It just about doubles I/O performance :D

Plus, I'm not sure if a phone filesystem like this even requires journals and safety if it impacts speed this much...

The only possible way to lose data is to yank out the battery without shutting down the phone first, which would never happen in normal use. As far as I know, the iPhone doesn't use journaling either. (Not like you can even remove the battery. ;) )
[Galaxy S I9000 Android Development] taapires:
Tested the script and scored 2244.

Firmware: DDJG4
[Galaxy S I9000 Android Development] myslee_ovi:
i think we need a solution to change the base filesystem over the PIT and the kernel... it's much impressive!!!

I like this phone :)
[Galaxy S I9000 Android Development] titovic:
You mean the playlogos1 and userinit script combo from the Vibrant group, right?

I am using that setup on my JP3-loaded SGS right now and will try to convert the userinit script to do what RyanZA has whipped up.

Thanks ykk_five and RyanZA !!
[Galaxy S I9000 Android Development] RyanZA:
Ummm...

busybox mke3fs

mke3fs: applet not found

busybox mkfs.ext3

mkfs.ext3: applet not found

How do I format an ext3 on this thing? :/
[Galaxy S I9000 Android Development] dkcldark:
Actually, I've made a kernel using the vibrant's method.

I mean, using initd things not the playlogo1 stuff, right?

I'm using this kernel on my I9000 ATM..

but I'm not sure I'm allowed to release it.

I asked to the original poster but he doesn't respond.
[Galaxy S I9000 Android Development] BackfireNL:
Well actually your quite right! but it does improve the IO...

What this means for normal usage of your phone is that you don't have the app lag for the apps that run only on your EXT partition!

If there is a way to make the whole phone use EXT instead of RFS/FAT then whe have a winner on our hands!

Pii Calculation etc is just pure processor speed in the dalvik JIT environment...

But even processor speed is useless if you want to start up a app that needs to load lots of cache data of just regular data from a RFS partition...

The bottleneck in eclair is just the filesystem! as proven by this!

JIT will be fixed in froyo. If there is a way to use EXT in froyo we have a killer phone in our hands!
[Galaxy S I9000 Android Development] ykkfive:
from my test results, noatime and nodiratime didnt help. i can tell u that, i remount /cache, /dbdata, /data on every boot by adding noatime and nodiratime to the mount option
[Galaxy S I9000 Android Development] ykkfive:
kind of, i have put some custom scripts in playlogos1 also
[Galaxy S I9000 Android Development] ykkfive:
um.. sorry, i should say, ext3 is supported (can be mounted), but cannot be created in the phone. i created them in linux
[Galaxy S I9000 Android Development] RyanZA:
Ahh.. useless for a one click script then. :(

I'll just stick to EXT2!

There is definitely some difference with the different mount options - still testing it fully now.
[Galaxy S I9000 Android Development] sedinix:
how apply whole script ?? any progs ? or I must make all comends in phon in beter terminal ?
[Galaxy S I9000 Android Development] myslee_ovi:
it's not possible to change the mkfs tool into the full one?

i think the busybox is only a lightwieght toolkit
[Galaxy S I9000 Android Development] titovic:
Are you using the kernel from (xdaforums.com/showthread.php?t=744655)?

I've tried that but I get stuck in the Vibrant boot screen (since I have Froyo) so had to make do with the legacy approach of playlogos1 :(

That etc/init.d approach gives the user ability to run additional scripts at boot time and hopefully later on, additional scripts to run prior to shutdown.

Hopefully, that OP responds positively and we can combine that with this fix.
[Galaxy S I9000 Android Development] jodue:
i did this fix (thanks to the op for reporting) with the playlogos1 skript to make it permanent and get ~2100 now. for me it's better than the mimocan fix because of 2 reasons:

*) you can take the sd card out if and when you want

*) you can flash another kernel if and when you want

without changing anything (links...)

in the long run it would be preferable if we could just repartition everything to ext3 tho' ...
[Galaxy S I9000 Android Development] ykkfive:
i think so too, but the diff is insignifcant

hope u can fine tune it
[Galaxy S I9000 Android Development] ykkfive:
exactly what i thought!
[Galaxy S I9000 Android Development] titovic:
Have you guys tried mke2fs/tune2fs? I have not used them yet but had seen them in use on scripts. One of them can convert from ext2 to ext3 and/or ext4
[Galaxy S I9000 Android Development] ykkfive:
not for android rite now, althougt busybox has tune2fs with limited functions
[Galaxy S I9000 Android Development] RyanZA:
Okay here we gooo!

128mb in /data
-o noatime,nodiratime,errors=continue
Quadrant: 1766
dd: 10240000 bytes transferred in 0.300 secs (34133333 bytes/sec)

128mb in /data
no mount options
Quadrant: 1745
dd: 10240000 bytes transferred in 0.399 secs (25664160 bytes/sec)

1GB in /data
-o noatime,nodiratime,errors=continue
Quadrant: 2191
dd: 10240000 bytes transferred in 0.305 secs (33573770 bytes/sec)

As far as quadrant goes, 1GB vs 128MB is a huuuge difference in score! But what is the difference between 1GB and 128MB? The default EXT2 settings!

128MB:

Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
32768 inodes, 131072 blocks
6553 blocks (5%) reserved for the super user
First data block=1
Maximum filesystem blocks=262144
16 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

1GB:

Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
65536 inodes, 262144 blocks
13107 blocks (5%) reserved for the super user
First data block=0
Maximum filesystem blocks=4194304
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

And that must be it - blocksize is 4x the 128MB one.

Mount options seem to make a real difference for dd write speeds too.

I think I found a nice way to get stupid high Quadrant scores... use /dbdata with a 4K or 8K block size EXT2. Anybody want to try? :D
[Galaxy S I9000 Android Development] BackfireNL:
I have made a bounty thread for devs!

That involves a bounty for a usable and easy fix!

---> See this thread <---