Jump to content

Possible lag fix w/o an ext Partition or /data/data move suggested by Morfic


Guest DistortedLoop
 Share

Recommended Posts

Guest DistortedLoop

I hope morfic doesn't mind that I took the liberty to start a thread on an idea he's suggested over on the mimocan lag fix thread.

This is some interesting stuff that I think warrants its own thread and discussion outside of that topic.

It's interesting because he says it fixes the lag, and it's an easy thing to do that doesn't require ext partitions, symlinks or any of the other stuff that seems to be giving people problems doing the mimocan and Paul move-/data/data type fixes.

I haven't tried it yet, since I'm already lag fixed by moving /data/data, /data/dalvik-cache and /media to an ext 4 partition, and it's unclear if this would add more speed, but for those without the symlink based fixes, this might be a very easy fix to implement.

I'd love to see where this goes with testing.

Just to be clear, this is morfic's suggestion, I'm not taking credit for it, I haven't tried it, I'm not responsible for it, and I don't support it... :)

[email protected] ~ $ adb shell

$ su

# echo anticipatory > /sys/block/mmcblk0/queue/scheduler

# echo anticipatory > /sys/block/mmcblk1/queue/scheduler

# echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# echo 70 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

I would like to know what user who have not yet flashed the kernel to move /data/data/ to mmcblk1p2 experience with these settings. It's non destructive and non invasive.

Obviously i think this makes utter sense and i feel "the phone is snappy", hence the "what do you think.

There are a few more that are exposed in the Vibrant kernel, just need some more subjective testing on those, as they are new to me, above is more "proven oldies but goldies"

Don't like this at all, reboot or if you are not a fan of rebooting:

This is what you should find before applying the lines above:

[email protected] ~ $ adb shell

$ su

# echo cfq > /sys/block/mmcblk0/queue/scheduler

# echo cfq > /sys/block/mmcblk1/queue/scheduler

# echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# echo 75 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

------------------------------------------------------------------------------------------------------

I have not tried yet what anticipatory does when changing it to the stl partitions, that's next.

stl partitions:

/dev/block/stl9 /system rfs rw,vfat,llw,check=no,gid/uid/rwx,iocharset=utf8 0 0

/dev/block/stl10 /dbdata rfs rw,nosuid,nodev,vfat,llw,check=no,gid/uid/rwx,iocharset=utf8 0 0

/dev/block/stl11 /cache rfs rw,nosuid,nodev,vfat,llw,check=no,gid/uid/rwx,iocharset=utf8 0 0

/dev/block/stl3 /efs rfs rw,nosuid,nodev,vfat,llw,check=no,gid/uid/rwx,iocharset=utf8 0 0

------------------------------------------------------------------------------------------------------

Now if you think "But cfq is better for interactivity" yes and no, intention is to be better, but you have a stall, and the better your throughput, the shorter the stall. so you could see if deadline shortens stalls further w/o affecting your phone otherwise.

The move to a faster card is obviously right, the problem is compounded by slow devices, just thought it wouldn't hurt to try to make it more bearable with the slow partition. And no, i don't have the files needed to pack this into a nice clean boot.img.

Edited by DistortedLoop
Link to comment
Share on other sites

Guest AndyCr15

This is considered the easier way?!?!

Have you tried it yet then?

**EDIT** Also, whats this about moving /data/dalvik-cache? Sorry, I've not been following these threads for the last week or so.

Edited by AndyCr15
Link to comment
Share on other sites

Guest DistortedLoop

So, I'm doing some research on this and there's not a whole lot of talk about it in any of the Galaxy S specific forums, but I found some interesting stuff that probably applies to us just the same.

CFQ seems to have some speed issues in general on the linux kernel according to this thread: http://kerneltrap.com/mailarchive/linux-ke...10/4/16/4559648

Cyanogen posted a few months ago that things just seem to run smoother on the G1 with anticipatory: http://forum.xda-developers.com/showpost.p...mp;postcount=11, but actually, he seems to flip flop on using it or not. The last change I see in his changelogs for the Nexus One 5.x ROMs is to switch back to CFQ i/o scheduler.

Both those threads suggest noop works best, and the first post in the one with cyanogen quotes wikipedia as saying that noop is best for flash devices: http://forum.xda-developers.com/showthread.php?t=576004

My favorite Nexus One kernel (pershoot's) uses deadline, but I just checked on the phone and it has noop available as the only other option. This is also a FroYo kernel and that may make a difference.

It appears that the SGS, at least with mimocan's kernel, supports noop, anticipatory, deadline and cfq.

Check yourself with this command from adb shell: cat /sys/block/mmcblk0/queue/scheduler

my results:

# cat /sys/block/mmcblk0/queue/scheduler

noop anticipatory deadline [cfq]

I think I'll try this on my phone with noop or deadline, probably noop at first.

That G1 thread even has the userinit.sh edits to enable this at boot if you decide you want it permanently.

Link to comment
Share on other sites

Guest DistortedLoop
This is considered the easier way?!?!

Sure, I'd say it's the "easy" way because all you're doing is typing a few commands into the terminal on the phone or through adb.

It requires no modifications to your sdcard's partitions, no custom kernel to be flashed via Odin, no data folders to be moved, and no symlinks to be created. Given the amount of problems doing those things have caused the less experienced in the mimocan thread, I'd say this is pretty easy. Heck, I'm sure you could write a script and put it in the ASE folder and just run it that way for repeated implementation if you reboot.

Additionally, it's easy because the only thing you have to do to UNDO it is to reboot the phone! No breaking symlinks and moving data folders back where they belong, which seems to be another tough one for some to accomplish.

Have you tried it yet then?

Not yet. I'm actually going to do it on my phone as soon as I post this, but since I'm already mimo'd I don't know if the results will be noticeable compared to someone who's not.

Haven't decided if I'll do noop or deadline.

**EDIT** Also, whats this about moving /data/dalvik-cache? Sorry, I've not been following these threads for the last week or so.

It's something I came up with after messing around with the kang-o-rama kernel for my Nexus One and the NEW apps2sd method (now called apps2ext for FroYo) that Darktremor came up with. One of the options he has with the multiple scripts in his hacks is to move the dalvik-cache someplace or another. I figured it might make a difference for us, and it did for me - I moved mine to ext 4. My phone's gone from high 1300s to low 1500s on Quadrant after doing that.

A new concern I've seen is that on the Vibrant forums they're talking about needing to run ef2chk or fsck on the ext4 partition and that guys are seeing Quadrant of 2000 after doing that. I wonder how much this translates to real-world daily use and user experience. Benchmarks are cool, but they don't always translate to making the phone any more pleasurable to use in real life.

Link to comment
Share on other sites

Guest DistortedLoop

I think the ondemand processor settings are problematic on my phone. I noticed this with SetCPU installed as well. When I set to ondemand with SetCPU, my phone wouldn't wake from sleep and I had to pull the battery and uninstall SetCPU to settle things down.

I just tried the above with noop, and the phone worked, but once it went to sleep, it wouldn't wake up. I didn't have to pull the battery, but long pressing the power button just powered it back up.

Going to try again by just messing with the noop settings and not touching the cpu governor.

Link to comment
Share on other sites

Guest Case_

Yep, tried that and after a while, the phone didn't wake up from sleep. And I have to note that before it froze (running for about an hour), I didn't really notice any difference in lag as opposed to stock JM5 (though in JM5 the lag is reduced a lot by default).

Link to comment
Share on other sites

Guest aeo087

I think it's fantastic that all these optimizations have been found. From what I've researched the real problem lies with the RFS partitions that Samsung using...

In the thread below from XDA-developers, ykk_five and RyanZA have managed to create a ext2 partition block inside the RFS partitions greatly increasing i/o performance.

http://forum.xda-developers.com/showthread.php?t=748596

It frustrates me that we haven't seen Samsung make any attempts to change these problematic partitions with the firmware updates; until that is done, the phone will always be i/o handicapped. The procedure for ykk_five's fix is still a bit too complicated for my taste, but RyanZA and raspdeep are working hard to make this an easy script to apply. Hopefully we can get Samsung to take a hard look at these fixes and make our phones as fast as they are supposed to be.

Link to comment
Share on other sites

Guest DistortedLoop
I think it's fantastic that all these optimizations have been found. From what I've researched the real problem lies with the RFS partitions that Samsung using...

In the thread below from XDA-developers, ykk_five and RyanZA have managed to create a ext2 partition block inside the RFS partitions greatly increasing i/o performance.

http://forum.xda-developers.com/showthread.php?t=748596

It frustrates me that we haven't seen Samsung make any attempts to change these problematic partitions with the firmware updates; until that is done, the phone will always be i/o handicapped. The procedure for ykk_five's fix is still a bit too complicated for my taste, but RyanZA and raspdeep are working hard to make this an easy script to apply. Hopefully we can get Samsung to take a hard look at these fixes and make our phones as fast as they are supposed to be.

I saw that thread earlier and didn't pay it much attention, but just finishing it now, it's a pretty interesting read...confirms and fine tunes what we all already knew, that there was something screwy with the i/o on the SGS, and apparently the problem is the RFS file system they're using.

That one actually seems a little trickier than the mimocan method, though, but it's very clever and out of the box thinking!

It will be interesting to see if the more clever ROM makers manage to just make ROMs that use a better file system on the phone instead of RFS in the first place, which would seem to be the real problem here. Contributors are suggesting using ext for the whole ROM, but the Nexus One uses YAFFS2, which would probably be a better choice.

I'd love to get Quadrant scores in the 2000 range, but not sure that particular method is worth the effort yet.

Link to comment
Share on other sites

Guest DistortedLoop

So I tried this with all four supported i/o schedulers. Quadrant scores pretty much the same. In hindsight, I'm not surprised, since I've already done the mimocan fix, and the OP specifically said it was for non-mimocan users.

I'll probably run with deadline for a while and see what happens - there must be a reason Pershoot's using it in his N1 ROMS over noop.

I'm really looking forward to someone who hasn't done any other hacks reporting back results with this method...it's stupid easy to do, totally safe, totally reversible with no effort beyond typing two lines into terminal or just rebooting the phone.

I think the ondemand processor settings are problematic on my phone. I noticed this with SetCPU installed as well. When I set to ondemand with SetCPU, my phone wouldn't wake from sleep and I had to pull the battery and uninstall SetCPU to settle things down.

I'll confirm that after not messing with the cpu governor, my phone has not frozen and wakes from sleep instantly. However, this might be the reason I'm getting very little difference in performance on the phone between the four different tests I ran with the i/o scheduler.

I don't see a lot of SetCPU talk around here, it might be worth starting a thread on to see if others are using it on the SGS for any reason. My original thought was that I could tweak the phone's settings to conserve some battery juice while sleeping, unfortunately it seems to put the phone into a coma, which is a bit deeper sleep than I wanted.

Link to comment
Share on other sites

Guest Kilack
I think it's fantastic that all these optimizations have been found. From what I've researched the real problem lies with the RFS partitions that Samsung using...

In the thread below from XDA-developers, ykk_five and RyanZA have managed to create a ext2 partition block inside the RFS partitions greatly increasing i/o performance.

http://forum.xda-developers.com/showthread.php?t=748596

It frustrates me that we haven't seen Samsung make any attempts to change these problematic partitions with the firmware updates; until that is done, the phone will always be i/o handicapped. The procedure for ykk_five's fix is still a bit too complicated for my taste, but RyanZA and raspdeep are working hard to make this an easy script to apply. Hopefully we can get Samsung to take a hard look at these fixes and make our phones as fast as they are supposed to be.

Oh nice find, they just posted a step by step guide for it too...

I'm going to give it a whirl, be nice to have everything internally.

Link to comment
Share on other sites

Guest Gary Crutcher
I hope morfic doesn't mind that I took the liberty to start a thread on an idea he's suggested over on the mimocan lag fix thread.

This is some interesting stuff that I think warrants its own thread and discussion outside of that topic.

It's interesting because he says it fixes the lag, and it's an easy thing to do that doesn't require ext partitions, symlinks or any of the other stuff that seems to be giving people problems doing the mimocan and Paul move-/data/data type fixes.

I haven't tried it yet, since I'm already lag fixed by moving /data/data, /data/dalvik-cache and /media to an ext 4 partition, and it's unclear if this would add more speed, but for those without the symlink based fixes, this might be a very easy fix to implement.

I'd love to see where this goes with testing.

Just to be clear, this is morfic's suggestion, I'm not taking credit for it, I haven't tried it, I'm not responsible for it, and I don't support it... :D

Tried the changes on Froyo, JP3.

Quadrant about the same before/after.

Will play around with the phone for a while to see if I notice any difference.

Thanks for posting this. :)

Link to comment
Share on other sites

Guest morfic
This is considered the easier way?!?!

Have you tried it yet then?

**EDIT** Also, whats this about moving /data/dalvik-cache? Sorry, I've not been following these threads for the last week or so.

No, that wouldn't be easy at all, some further posts on the old thread were not copied over.

As mentioned there using ASE (now SL4A) would be easier for this kind of stuff :)

Took me some tries to find a way to run those scripts with root privileges from SL4A.

using SL4A you can have all sorts of scripts at the push of a button, edit stuff w/o need for a pc each time, no pulling/pushing to change stuff.

#!/system/bin/sh
if [ "$(/system/xbin/busybox id -u)" == "0" ]; then

for f in mmcblk0 mmcblk1 stl3 stl9 stl10 stl11;
do echo anticipatory > /sys/block/$f/queue/scheduler;
done

echo 5 > /proc/sys/vm/dirty_ratio
echo -e "Switched to anticipatory\n"

else
echo -e "Getting root privileges\n"
su<$0
fi[/codebox]

is what you would enter into a script and it allows you to run it with 2 taps, one to start sl4a app, one to select the script you want to run, long press and choose to edit it, that's easy, in a "let me try this before i make permanent changes" kind of way.

For those who wanted to try the /data/data on mmcblk1p2 partition w/o flashing the kernel, to see if it would work from them, you could copy all the items from /data/data to your ext3 partition, then 'mount /dev/block/mmcblk1p2 /data/data' and try it out, don't delete or move anything else.

if you like it, follow the posts that mount the partition for you on each boot, if it did not work for you, just reboot and nothing has changed for you. (just don't install apps while you are testing, because they would be on the ext3 that's no longer mounted after a reboot, you can of course copy the contents on the ext3 over to the "real" /data/data later on (if you tested for a few days, you would want to have all current data in /data/data, not the days old content that was "hiding under mmcblk1p2")

[i][b]Why i asked people to try the above? Because i want to rule out what seems to work great for me is not tainted by me also using LauncherPro instead of ADW[/b][/i]

While i configure both in a way that avoids options that warn of "uses more ram/reduces performance", it's not identical to what i ran almost since day one of getting my Vibrant, where i quickly installed ADW, since i liked it from the mt3g that i upgraded to CM6rc2 for my daughter.

I am extremely happy with my Vibrant right now, with LauncherPro+anticipatory.sh.

i tried to tune cfq to see if i could make it work for me and initially the results seemed identical to anticipatory, until after a while of use i had my first larger lag again, which i had not seen in a while now. Was not as bad as it used to be, but it was noticable.

I am tempted to say what i like so much is more of a LauncherPro+anticipatory.sh combination than the switched scheduler alone.

I won't know for sure unless i get some feedback, if it helps other people who don't have /data/data on mmcblk1p2, great. If not, what are they using that it doesn't help/what is that helped me.

I can say i ran anticipatory on mt3g and CM4 and it helped there, and i used neither ADW nor LauncherPro, so it's not like i had no reason to try this on the laggy Vibrant.

On ADW as with LauncherPro i have 3 homescreens, only the middle has 2 widgets, Pure Messenger (Scrolling list widget) and NY Times. (In case you wonder on that)

Link to comment
Share on other sites

Guest Andrew Luecke
Cyanogen posted a few months ago that things just seem to run smoother on the G1 with anticipatory: http://forum.xda-developers.com/showpost.p...mp;postcount=11, but actually, he seems to flip flop on using it or not. The last change I see in his changelogs for the Nexus One 5.x ROMs is to switch back to CFQ i/o scheduler.

Samsung specifically recommends the use of the AS scheduler for RFS on: http://www.samsung.com/global/business/sem...s_FAQs_RFS.html

I'm assuming they recommend Anticipatory in their public faq after plenty of testing..

Link to comment
Share on other sites

Guest AndyCr15
Oh nice find, they just posted a step by step guide for it too...

I'm going to give it a whirl, be nice to have everything internally.

Where is the step by step? I don't see it :)

Do you have to revert Mimocan first?

How you now tried it, how's it going?

**EDIT** Ah, is it this - http://forum.xda-developers.com/showthread.php?t=749495

Edited by AndyCr15
Link to comment
Share on other sites

Guest DistortedLoop
Samsung specifically recommends the use of the AS scheduler for RFS on: http://www.samsung.com/global/business/sem...s_FAQs_RFS.html

I'm assuming they recommend Anticipatory in their public faq after plenty of testing..

Funny the recommend it, but don't ship the ROMs we're getting with it.

I think I'll add this to the ext2-on-RFS hack we're all drooling over now and see what happens.

Link to comment
Share on other sites

Guest morfic
Funny the recommend it, but don't ship the ROMs we're getting with it.

I think I'll add this to the ext2-on-RFS hack we're all drooling over now and see what happens.

Still happier with AS even with faster ext on rfs.

Quadrant went up, yes but user experience with cfq was still down.

Don't like loop mounting the file, i'll likely repartition my sd, try a few fs, then adjust userinit.sh to suit.

Keeping AS for sure.

Link to comment
Share on other sites

Guest Andrew Luecke
Funny the recommend it, but don't ship the ROMs we're getting with it.

I think I'll add this to the ext2-on-RFS hack we're all drooling over now and see what happens.

Yeah.. To me, that is a red flag which makes me worry a bit now. Or, they only recently added that after information gained from people hacking at their android phones (which is a possibility too). It's possible they already enabled it in their internal Froyo roms.

But anyway, if they recommend AS on their FAQ, AS is what should be used.

Link to comment
Share on other sites

Guest DistortedLoop
Still happier with AS even with faster ext on rfs.

Quadrant went up, yes but user experience with cfq was still down.

Don't like loop mounting the file, i'll likely repartition my sd, try a few fs, then adjust userinit.sh to suit.

Keeping AS for sure.

Is it that simlpe? Just format the drives with an appropriate FS? Android supports YAFFS2, at least the HTC versions of Android do.

Link to comment
Share on other sites

Guest morfic
Is it that simlpe? Just format the drives with an appropriate FS? Android supports YAFFS2, at least the HTC versions of Android do.

cat /proc/filesystems

Shows there is no yaffs2, no ext4.

Link to comment
Share on other sites

Guest DistortedLoop

I downloaded SL4A, copied your script into it's script creator, saved it, ran it. It doesn't work for me. SL4's output:

[:not found

Getting root privileges

[:not found

Getting root privileges

cannot open sh: no such file

Any ideas?

#!/system/bin/sh
if [ "$(/system/xbin/busybox id -u)" == "0" ]; then

for f in mmcblk0 mmcblk1 stl3 stl9 stl10 stl11;
do echo anticipatory > /sys/block/$f/queue/scheduler;
done

echo 5 > /proc/sys/vm/dirty_ratio
echo -e "Switched to anticipatory\n"

else
echo -e "Getting root privileges\n"
su<$0
fi[/codebox]

is what you would enter into a script and it allows you to run it with 2 taps, one to start sl4a app, one to select the script you want to run, long press and choose to edit it, that's easy, in a "let me try this before i make permanent changes" kind of way.

Link to comment
Share on other sites

Guest DistortedLoop
cat /proc/filesystems

Shows there is no yaffs2, no ext4.

You'd have to compile it in, I guess.

My cat /proc/filesystems confirms no yaffs2, but there is ext3 and ext4....but I am running mimocan's kernel and he added the support when he compiled.

Link to comment
Share on other sites

Guest Xoneso

Hey morfic.

Would you mind providing your sl4a scripts and the userinit.sh file? Would like to see how you got it setup

Btw i'm Tayutama on XDA :)

Link to comment
Share on other sites

Guest DistortedLoop
Hey morfic.

Would you mind providing your sl4a scripts and the userinit.sh file? Would like to see how you got it setup

Btw i'm Tayutama on XDA :)

He posted the sl4a script in this post on the first page. #13 in the thread I think.

I pasted the code into sl4, but when I run the script, it doesn't work. :D

I'd also like the userinit code. Would it be the same as the script? I think this switch to anticipatory is good idea and wouldn't mind having it occur at boot.

Link to comment
Share on other sites

Guest morfic
Hey morfic.

Would you mind providing your sl4a scripts and the userinit.sh file? Would like to see how you got it setup

Btw i'm Tayutama on XDA :)

[email protected] ~ $ cat userinit.sh 
#busybox mknod /dev/loop0 b 7 0;
#busybox losetup /dev/loop0 /data/linux.ex2;
#mkdir /data/ext2data;
#mount -t ext2 -o noatime,nodiratime,errors=continue /dev/block/mmcblk1p2 /data/ext2data;

for f in mmcblk0 mmcblk1 stl3 stl9 stl10 stl11;
do echo anticipatory > /sys/block/$f/queue/scheduler;
done

[email protected] ~ $ [/codebox]

Yes, it's the userinit.sh from the one click fix, i don't like loop mounting for some odd reason, but each time i try to mount mmcblk1p2 things blow up. (At least i now have a nandroid backup, so when i try again, it's not like the usual reinstall.

[codebox][email protected] ~ $ cat anticipatory.sh
#!/system/bin/sh
if [ "$(/system/xbin/busybox id -u)" == "0" ]; then

for f in mmcblk0 mmcblk1 stl3 stl9 stl10 stl11;
do echo anticipatory > /sys/block/$f/queue/scheduler;
done

echo 5 > /proc/sys/vm/dirty_ratio
echo -e "Switched to anticipatory\n"

else
echo -e "Getting root privileges\n"
su<$0
fi


[email protected] ~ $

So you see it's just a for loop added to userinit.sh where we don't need any self promotion.

post-620347-1281492459_thumb.png

After sl4a start.

post-620347-1281492473_thumb.png

Long press the script you want to edit.

post-620347-1281492497_thumb.png

Edit to your heart's content.

post-620347-1281492510_thumb.png

Hit menu to save or save and run the script.

post-620347-1281492524_thumb.png

What you should see (including the misspelling of privileges off the sl4a bug tracker,

where the self promotion is from.

While i think things stutter less with AS, i do think the biggest improvement is switching from ADWLauncher to LauncherPro. Even someone unaware of all the lag fix issues was impressed by switching to LauncherPro.

Remove the clutter that starts like layar, amazon_mp3.

Don't like to get rid of stuff? Buy Autostarts and keep stuff from getting started that you don't want running. Not just on startup, there are other intends where you go "Why is this one starting here?"

I am right now enjoying my phone w/o the sexy quadrant scores, yet it's majorly usable.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.