r/linux_devices • u/georedd • Nov 24 '10
Does any one know if this linked linux speed patch will work on an ( linux based) android phone like the G1? (all android phones are linux based with android running on top of linux so this speed up would be a boon.)
http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html4
u/cyansmoker Nov 26 '10
Everybody:
Before downvoting the OP, please be sure not to jump on the "but it's not the same scheduler" bandwagon.
Out of curiosity, I just did a line-by-line comparison of the scheduler code between three kernels: Linux stock 2.6.32.26, Android snapshot branch and HTC Incredible MR3 2.6.32.
Well, they are all different. But the question is: how different? Well, not different enough to be seen as "different schedulers."
Overall, the three branches use the fair scheduler.
On the Android side, the real-time portion does not let you add a task to the head of the queue; it seems more concerned with proper IRQ handling; the Incredible code aligns its timing on the clock rather than raw CPU time, again -- I suppose -- out of care for overall sync., including IRQ timing. The Incredible pushes the logic a bit further by making sure that it uses the high-res timer.
All tasks' iowait time is included in init's own iowait time.
Tasks enqueuing is simplified to ignore the "migrate" flag. However, load balancing is implemented and CPUs can be found not eligible for process migration. If they are, the same algorithm is used as in the stock kernel.
Now, does this mean that the patch will work on Android? I do not know; I have not looked at it. If you want, I can have a look. Or someone else can, obviously. Just trying to clear things up.
2
u/cyansmoker Nov 27 '10
I ended up responding to the question. I made a blog post out of it: http://nexus.zteo.com/blog/2010/11/26/so-is-android-using-the-linux-scheduler-can-i-patch-it/
-C.
2
u/aperson Dec 08 '10
I normally don't reply to posts after a day, but yours warranted a thanks.
Thanks!
2
u/tuba_man Nov 25 '10
The android team's version of the linux kernel is so far forked it may as well be a different kernel altogether. This scheduling patch may be something that can be put in place, it may not.
-2
u/georedd Nov 24 '10
for those who dont know android phones run linux.
android is a program that runs on top of linux. linux is the os for all the android phones.
android is just a modified java app on top of linux which runs other java apps as if it was an os but it isnt the os. Linux is the os..
we aren't talking about modding android. we are talking about modding the linux on the phones.
most of the phones can be and have been rooted online giving you complete linux console and terminal and su access.
I just wan tto know if anyone know sif the tricks in the linked page will work with the linux phones that are called "android" phones.
3
Nov 25 '10 edited Nov 25 '10
Android is not a "program that runs on linux"... linux is not the os, linux is the kernel. An "os" is the whole of the package of programs that allows the system to run. Android IS the OS
Android is more well known as a linux distribution: a package of software that includes the linux kernel and software. Android consists of more than the dalvik bytecode interpreter, it consists of a windowing subsystem, dalvik, linux kernel, power management and permissions modifications, and its own custom scheduler (among many other driver frameworks). The "fix" (edit: spelling) you're proposing only works on linux's default scheduler....which android doesn't utilize...
Android does not run java. Android merely allows you to program in java, and converts it into dalvik bytecode. If it "ran" java, it would have a special processor to interpret jvm bytecode directly. Please, dont go giving people incorrect information. You don't know what your talking about and its obvious.
1
u/cyansmoker Nov 25 '10
"you're"
Sorry I couldn't resist correcting the correction ;)
1
Nov 25 '10
Sorry, was typing it on a Droid keyboard from a family Thanksgiving lunch...I know it's sloppy. I didn't feel like hitting alt + m to find the apostrophe.
-1
u/georedd Nov 29 '10
First thanks for the detailed info.
Second the reason I asked was I wasn't sure....
Anyway dalvik and the bytecode it produces is a version of a java interpreter/compiler is it not? It is more of a precomplier than interpreter but it is precompiling java is it not?
1
Nov 29 '10 edited Nov 29 '10
No. Dex (Java Class -> Dalvik compiler) produces dalvik bytecode.
The process goes like this:
Java Source Code -> Javac compiles source into .class files (Normally, this is the part where they'd be run from the JVM) -> DEX takes the .class files, and compiles THOSE into Dalvik bytecode (NOT JAVA). -> Dalvik VM on Android interprets Dalvik bytecode. Dalvik takes parts of that bytecode and compiles it on-the-fly into machine code using the JIT compiler to speed up the parts that need speeding up.
Dalvik is both a compiled, and an interpreted bytecode. Android does not run Java.
0
u/georedd Nov 29 '10
So you are saying Dalvik translates java into a new language which it then makes into bytecode.
otherwise dalvik is a java precompiler.
anyway thanks.
however the programs are written in java then converted to dex so in a way android does run java. (source http://en.wikipedia.org/wiki/Dalvik_%28software%29 )
Semantics.
anyway to get back to the main point/post an android phone is definitely a linux machine running some variant of java/dalvik on top so shouldn't the linux speedup script perhaps work on android phones?
1
Nov 29 '10 edited Nov 30 '10
AS I SAID: NO.
Android uses its own scheduler. It does not use the standard Linux scheduler. Please for the love of god go teach yourself at least 1 related technology. Linux, Java, Computer Science, ANYTHING...and fully understand it before you go arguing with someone who DOES know these things.
Dex could be made to change ANY language into Dalvik bytecode. If it converted python, java, and ruby into dalvik...would you say that Android is running Python? No...because these handsets would bog down under a full interpreter like that. The "Intermediary language" is Java. Android doesn't run Java. That's the whole fucking point of the Oracle lawsuit...
You cannot run AWT/SWING components, you cannot use the Java UI libraries, you cannot use 1/2 of the stuff in java because Dalvik doesn't support it. Dalvik IS NOT JAVA.
Oh, and look up the word semantics. It does not mean what you think it means. Either that or you're obnoxiously using it in as broad a reference as humanly possible.
-2
u/georedd Nov 30 '10
".and fully understand it before you go arguing with someone who DOES know these things."
Stop being a superior dick.
I wasn't arguing. You are arguing.
Go impress yourself.
4
Nov 30 '10
I wasn't arguing. You are arguing.
Excellent retort. Straight from the mind of a 5 year old. /facepalm
-1
4
u/aperson Nov 24 '10
I doubt this will make it into android any time soon. While android and linux are both linux, that does not make them the same beast.