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

Trouble with running multiple hacks at once is you can't be sure which, if either causes a problem.

Bluetooth was never a problem on my SGS with my car with cfq scheduler and mimocan fix. After applying anticipatory and the loop mount fix, bluetooth has had issues connecting to the car unless I reboot, and one attempt to connect to bluetooth caused the phone to shut itself off on its own. That's the first time the phone's ever crashed itself in just normal use.

Again, never a problem on the phone, even with the mimocan fix applied.

I'm not going to enable the anticipatory scheduler and see if the bluetooth settles down.

Anyone else noticed bluetooth issues with this.

Link to comment
Share on other sites

Guest DistortedLoop

I'm still getting those errors:

[:not found

Getting root privileges

[:not found

Getting root privileges

cannot open sh: no such file

My screens look exactly the same as yours. No ideas? I've got busybox and su (obviously) and the latest SL4A from google code.

post-654571-1281563047_thumb.jpg

post-654571-1281563060_thumb.jpg

Edited by DistortedLoop
Link to comment
Share on other sites

Guest morfic
I'm still getting those errors:

[:not found

Getting root privileges

[:not found

Getting root privileges

cannot open sh: no such file

My screens look exactly the same as yours. No ideas? I've got busybox and su (obviously) and the latest SL4A from google code.

I ran 'busybox --install -s /system/xbin/'

Ti get all the 'busybox tools, some of which are [ and ]

Got tired of prefixing stuff with 'busybox' all the time to get a decent cp or mv.....

Link to comment
Share on other sites

Guest DistortedLoop
I ran 'busybox --install -s /system/xbin/'

Ti get all the 'busybox tools, some of which are [ and ]

Got tired of prefixing stuff with 'busybox' all the time to get a decent cp or mv.....

Ahh! LOL. Okay, that makes sense. Sometimes the obvious escapes us.

Installed busybox and script runs fine. I should have thought of just adding busybox to each line as well.

What's the thinking you have with the swappiness and dirty_ratio flags?

Thanks for you efforts here!

Link to comment
Share on other sites

Guest morfic
Ahh! LOL. Okay, that makes sense. Sometimes the obvious escapes us.

Installed busybox and script runs fine. I should have thought of just adding busybox to each line as well.

What's the thinking you have with the swappiness and dirty_ratio flags?

Thanks for you efforts here!

Forget swappiness, we have no swap. It was just a "unless it affects a swapless system by accident (aka bug)" kind of thinking of mine.

dirty_ratio default is 10%, and i am checking if 5% helps (since i am not using the loop mount fix)

it'll certainly change how much you would feel a stall since only half the amount of data could be written back at any one time.

if i can find some others that proof useful on a phone (luckily it's closer to a desktop than a server, so it's not too difficult relating them)

most linux defaults are better on a server than a desktop.

on a desktop that has swap, you WILL want to adjust swappiness to something small. default is 60%, imagine your hard drive writing back 60% of your 4GB of ram at one time, it makes kittens cry

even 5% are then 200MB that get written in one swoop

Edited by morfic
Link to comment
Share on other sites

Guest angryPirate12
Have you tried it? change anticipatory to noop and let me know how you like it.

i Spent a few hours one night running quadrant and linpack, switching between anticipatory, deadline noop, and cfq each being ran with both conservative or ondemand. Now i simply used ADB to make the switch than ran 'cat' to make sure the phone was operating under each config. I can say handily that noop out performed everything, not by much just a hundred points here and there in quadrant. The only question this doesn't really answer is whats best for everyday use?

running eugene373's Vibrant4 ROM, JAC's OC'd 1.2ghz kernel, and internal SD lag fix

Quadrant scores, 2 runs each

D/C: 2456 2478

D/O: 2469 2520

N/C: 2420 2511

N/O: 2508 2556

A/C: 2408 2544

A/O: 2476 2505

Q/C: 2467 2519

Q/O: 2482 2518

Q=qfc, A=Anticipatory, N=noop, D=deadline and O=ondeman, C=conservative

Link to comment
Share on other sites

Guest morfic
i Spent a few hours one night running quadrant and linpack, switching between anticipatory, deadline noop, and cfq each being ran with both conservative or ondemand. Now i simply used ADB to make the switch than ran 'cat' to make sure the phone was operating under each config. I can say handily that noop out performed everything, not by much just a hundred points here and there in quadrant. The only question this doesn't really answer is whats best for everyday use?

running eugene373's Vibrant4 ROM, JAC's OC'd 1.2ghz kernel, and internal SD lag fix

Quadrant scores, 2 runs each

D/C: 2456 2478

D/O: 2469 2520

N/C: 2420 2511

N/O: 2508 2556

A/C: 2408 2544

A/O: 2476 2505

Q/C: 2467 2519

Q/O: 2482 2518

Q=qfc, A=Anticipatory, N=noop, D=deadline and O=ondeman, C=conservative

Con Kolivas suggested noop for having the least through put.

As it would require less cpu time during a stall.

The stalls have to do with the (linux) VM (don't confuse it with a java VM), you can read about dirty pages and write back caching.

And the info will be much more accurate than when I rephrase it.

I lowered the dirty ratio to 5% of the ram, then the stall could be only half as bad as with the default 10% set.

The reason is the slow writes on the /data partition, which exposes this possible stall condition in the kernel.

The loop mount fix speeds up the physical writes.

If you run linux on your desktop there are similar things you can tweak, stemming from most defaults being wrong for an interactive desktop.

A phone is much like a desktop with slow slow disks.

I encourage some reading in dirty pages, write back caching, swappiness, linux vm for a good understanding.

Swappiness to default to 60 is fun, should be around 5, luckily there is no swap in our android phones.

What we want is vm improvements to make it into 2.6.36 and to get that for our phones.

Alternatively, some one who can build a vibrant kernel to patch it with bfs for 2.6.35 and build us that.

Link to comment
Share on other sites

  • 2 weeks later...
Guest Rdy2Go
morfic-

Are you still playing around with this?

Wondering what settings you've chosen for normal usage.

I prefer deadline scheduler, it's simple, low CPU but it's focused on preventing starvation while reading at the cost of writing speed - it made my Galaxy S fly,

JM1 + One Click Lag Fix + busybox and this command (root)

for f in mmcblk0 mmcblk1 stl3 stl9 stl10 stl11;

do echo deadline > /sys/block/$f/queue/scheduler;

done

Link to comment
Share on other sites

Guest morfic
I prefer deadline scheduler, it's simple, low CPU but it's focused on preventing starvation while reading at the cost of writing speed - it made my Galaxy S fly,

JM1 + One Click Lag Fix + busybox and this command (root)

for f in mmcblk0 mmcblk1 stl3 stl9 stl10 stl11;

do echo deadline > /sys/block/$f/queue/scheduler;

done

I am still using that loop in userinit.h, setting anticipatory, but then rather soon run my deadline script, but been so busy with work, i didn't get to much else.

Rather than the loop mounted ext2 on rfs, i mount mmcblk1p2 with symlinks to the directories on that mount point. What made things blow up on the xt2 move was simply that the mount i have wants options in a particular order, while i wrote them the order i would use on my desktop, turns out that does not fly :huh:, no more wiping Vibrant to get back into OS, when the mount fails and there is no /data/data and rest, it's just stuck.

My little spare time was consumed on building a RTAI kernel for my desktop, since i wanted to test my desktop's latencies, to see how something like this would fare as PC for the cnc control we are going to use, funny thing is, the newer the cpu, the worse all the power savings and frequency scaling and deep sleep make the hardware for a realtime system,

Would like to have some time to evaluate /proc/sys/vm/vfs_cache_pressure some more.

Btw, using the ext2 on my class6 instead of the loop mounted /data/data i get a slightly slower quadrant score, makes me wonder if the loop mounted fix gets some double caching during the benchmark (shouldn't but seems that way)

If linux is on your desktop, keep an eye on this:

http://lkml.org/lkml/2010/8/26/327

And people need to stop calling the BFS scheduler names, there was one bad revision, that did get picked up and used on a cm4.something release, ever since people are split about it, bfs on a cell phone is amazing.....if someone could build us a recent kernel for the vibrant and includes bfs, i am pretty confident we would like it.

for the mt3g, i could always build a bfs kernel for cm, even when he stopped including it, later was easier to just d/l one of the many offerings, long story short, i MISS having bfs on my phone.

If you run 2.6.35 vanilla, go patch it and build it with -ck1 (are larger patch set from the guy who made bfs) and then try your system again, of course if you tell me you never noticed any UI lags or general poor interactivity, then you will probably not see it benefit you much.

Side note: Benchmarks are actually bad, because interactivity most of the time works against throughput. So perhaps i end up editing the quadrant line up there out after a while ;)

Link to comment
Share on other sites

Guest Rdy2Go
Side note: Benchmarks are actually bad, because interactivity most of the time works against throughput. So perhaps i end up editing the quadrant line up there out after a while :huh:

That's what the majority does not understand - we talk about responsiveness here, not performance...

BTW, I've made some experiments with SSD disks and flash cards using various schedulers and the results are totally different than for traditional hard disks.

For instance anticipatory scheduler focuses on contiunous read and avoiding head movement which is not the case for flash drives.

Completely different rules apply here.

The community (Linux SSD) recommends NOOP or DEADLINE schedulers, I prefered DEADLINE for it's focus on preventing read starvation.

It works the best (elevator = deadline) for my Asus EEE PC 901 with SSD drives and attached SD cards.

Writes are slower, but there's much less lag when browsing web or opening folders because "read" operations have priority.

The same seems to work on my Galaxy S with stock JM1 with or without one-click-lag-fix.

Edited by Rdy2Go
Link to comment
Share on other sites

Guest DistortedLoop
That's what the majority does not understand - we talk about responsiveness here, not performance...

BTW, I've made some experiments with SSD disks and flash cards using various schedulers and the results are totally different than for traditional hard disks.

For instance anticipatory scheduler focuses on contiunous read and avoiding head movement which is not the case for flash drives.

Completely different rules apply here.

The community (Linux SSD) recommends NOOP or DEADLINE schedulers, I prefered DEADLINE for it's focus on preventing read starvation.

It works the best (elevator = deadline) for my Asus EEE PC 901 with SSD drives and attached SD cards.

Writes are slower, but there's much less lag when browsing web or opening folders because "read" operations have priority.

The same seems to work on my Galaxy S with stock JM1 with or without one-click-lag-fix.

I'll start running DEADLINE on mine.

I am so frustrated with the SGS at this point I'm ready to toss it out the window. Using Samset rom and Samset/Mimocan kernel with a2sd lag fix and it was rocking for 12 hours, then all of a sudden wakeup lag so crazy I was going to smash the phone. It was like this: hit the home button, the lock screen comes on but won't respond to finger input. Screen turns off, hit home, comes on, won't respond, turns itself off, blah blah, for about 15 tries (no exaggeration). Argh.

Link to comment
Share on other sites

Guest morfic
I'll start running DEADLINE on mine.

I am so frustrated with the SGS at this point I'm ready to toss it out the window. Using Samset rom and Samset/Mimocan kernel with a2sd lag fix and it was rocking for 12 hours, then all of a sudden wakeup lag so crazy I was going to smash the phone. It was like this: hit the home button, the lock screen comes on but won't respond to finger input. Screen turns off, hit home, comes on, won't respond, turns itself off, blah blah, for about 15 tries (no exaggeration). Argh.

I can't say I have seen this in a while.

Went back to deadline, fixed a typo that kept cache pressure from being set.

Dirty Ratio still at 5%


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

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

echo 90 > /proc/sys/vm/vfs_cache_pressure
echo 5 > /proc/sys/vm/dirty_ratio
echo -e "Switched to deadline\n"

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



[/codebox]

Is what I run right now.

[codebox]mkdir /data/ext2data;
mount -w -o noatime,nodiratime,errors=continue -t ext2 /dev/block/mmcblk1p2 /data/ext2data;

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

userinit.sh

Yes, still executing deadline script through sl4a

Edited by morfic
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.