• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[ROM][DEV][BrickedRom][Feb.02]-[CM9Kang]-[v4]-[KSM]-[Touchscreen-fixes]

Search This thread

show-p1984

Inactive Recognized Developer
Jul 30, 2011
3,700
11,805
##DISCLAIMER##
Though this is tested and I am using this, and nothing evil happened until now, it might slap you so hard in your face that not even google is able to find you anymore.
No kidding: !Experimental! This does not fix one bug of CM9 nor does it attempt to do so. So don't b*t*h me about that. This is meant as a test for KSM, to see if any problems arise and how much use (performance gain / more free ram) this gives on Android. (theoretically it should be very useful)



For everyone who wants to give it a try:


Bricked-CM9Kang v4
based on AOSP CM9 #Kangified :p

What does it give you:
Everything from CM9 + Touchscreen fixes (Dees_Troy27) + KSM (Kernel Samepage Merging) + fixed init.d script autoexecution on bootup (turl)

Bricked v0.4 with KSM support, Default clocks @ 1566/192 ondemand
- OC up to 1914Mhz, Voltage Control via sysfs (SystemTuner, etc), etc, etc.... Look here.

Install:
Do you want a fresh install? Wipe data/factory reset & just flash from recovery.
Already on cm9 and don't want to loose your data? Just flash over your current install without wiping (don't forget to reinstall gapps afterwards).

Download:

v4
ROM + Kernel:
mediafire.com: Click Me
http mirror: Click me
SHA1: 14db526c93962359995ea260c80d2811ba32eaae


Gapps: Click Me
SHA1: 1d277d2d7e802eb13975757df46c09afbaafcd2c

Gappsfixer: Click Me
This removes bad <shared-user> elements from packages.xml and lets android regenerate them. This fixes a problem with gapps signatures. (Just flash it after gapps, there can nothing go wrong)
SHA1: 5b66a2e160922626d67b30b459b5323deb8f549d

#cyanogenmod-touchpad Readme and Gapps:
http://ergh.org/cmtp/

Mirror (Folder by jassycliq):
mediafire.com, adfree: Click Me


What is KSM - Kernel Samepage Merging?
From Wikipedia, the free encyclopedia


Kernel SamePage Merging (KSM) (also: Kernel Shared Memory, Memory Merging) lets system share identical memory pages amongst different processes or virtualized guests. This is done by scanning through the memory finding duplicate pages. The duplicate pair is then merged into a single page, and mapped into both original locations. The page is also marked as "copy-on-write", so the kernel will automatically separate them again should one process modify its data.[1]
KSM was originally intended to run more virtual machines on one host by sharing memory between processes as well as virtual machines. Upon implementation, it was also found to be useful for non-virtualized environments where memory is at a premium [2][3]. An experimental implementation of KSM by Red Hat found that 52 virtual instances of Windows XP with 1GB of memory, could run on a host computer that had only 16GB of RAM [4].
KSM first appeared in the version 2.6.32 Linux operating system kernel [2]. To be effective, the operating system kernel must find similar memory pages held by different processes. As well it needs to decide whether the pages are going to update infrequently enough that SamePage Merging would be an efficient use of processor resources [3]. When first proposed, there were concerns that this feature could be exploit as a security vulnerability (this concern has since been addressed). Another concern is that although memory usage is reduced, CPU usage is increased, thus negating potential increases in performance [1].

References
  • ^ a b "Home Page". lwn.net. kernel.org. Retrieved 2010-08-21.
  • ^ a b "Home Page". IBM DeveloperWorks. IBM. Retrieved 2010-08-21.
  • ^ a b "Home Page". kernel.org. kernel.org. Retrieved 2010-08-21.
  • ^ "Home Page". kernelnewbies. kernelnewbies. Retrieved 2010-08-21.
more to KSM: http://bitcube.co.uk...merging-and-kvm


How to see the Magic happening?
Code:
cat /sys/kernel/mm/ksm/full_scans
cat /sys/kernel/mm/ksm/pages_shared
cat /sys/kernel/mm/ksm/pages_sharing
cat /sys/kernel/mm/ksm/pages_to_scan
cat /sys/kernel/mm/ksm/pages_unshared
cat /sys/kernel/mm/ksm/pages_volatile
cat /sys/kernel/mm/ksm/run
cat /sys/kernel/mm/ksm/sleep_millisecs
or just:
Code:
cat /sys/kernel/mm/ksm/*
to get all at once.
Check your RAM stats with:
Code:
free



Source for KSM implementation:

Android source modifications: Click Me
Kernel source modifications: Click Me
(ofc KSM must be enabled in your kernel config)

Source for Bricked:
Click Me


Thanks to everyone who ever contributed anything (even only a whitespace) to any of the used software.
 
Last edited:

show-p1984

Inactive Recognized Developer
Jul 30, 2011
3,700
11,805
Code:
[B][U][SIZE="5"]Changelog:[/SIZE][/U][/B]
[B]*** v4 ***[/B]
ROM:
synced with CM9 repo @ 05:04 PST 31/01/12
KSM code cleanup. Testing new configuration
Tweaking KSM, lowering CPU usage
Fixing restore of gapps after install (my fault, c&p was being a b*tch)
Allow reboot to recovery (http://review.cyanogenmod.com/#change,12311)
Allow power options menu (http://review.cyanogenmod.com/#change,12315)
Added CombinedBar Auto Hide (http://review.cyanogenmod.com/#change,12281)
SurfaceFlinger: Set the buffer size in the GraphicBufferAlloc (http://review.cyanogenmod.com/#change,12263)
Preference to disable bootanimation for faster boot (http://review.cyanogenmod.com/#change,12169)

Kernel:
ksm update from bricked-pyra source
Lowered min voltage once again (now: 700mV)
Updated KGSL driver with bricked-pyramid:
msm: kgsl: 8Stages 3D scaling, highest @ 300Mhz (fraction 33)
msm: kgsl: 6stages 2D scaling, highest @ 266,7Mhz, 33,35% Overclocked (fraction 100)
msm: kgsl: GPU off while screen off!
msm: kgsl: improved KGSL suspend
msm: kgsl: Use the correct virtual address for pmem regions
msm: kgsl: Delay 30ms to make sure GPU is ready during resume time
msm: kgsl: Update pwrlevel_change
msm: kgsl: Add sysfs attribute to turn GPU DCVS off/on
msm: kgsl: Early Suspend drivers
msm: kgsl: Turbo Mode
msm: kgsl: Don't check for idle while suspended
msm: kgsl: Make kgsl_idle_check check if a nap is allowed
msm: kgsl: fix parameter checking in adreno_ringbuffer_issueibcmds
msm: kgsl: Abort kgsl_pwrctrl_wake() when in KGSL_STATE_INIT
msm: kgsl: create singlethread wq instead of per-cpu wq
msm: kgsl: Fixing earlysuspend/lateresume for multiple devices.
msm: kgsl: run kgsl_idle_check after resuming a device
msm: kgsl: fix coding derp for init pwrctrl

[B]*** v3 ***[/B]
repo synced with CM9 (18:00 CET, 27/01/12)
touchscreen fixups by Dees_Troy, ts: lower touch threshold to help with light touches
touchscreen optimization by Dees_Troy, remove unneeded code and optimize filter
disable_dock_switch, fixes touchstone freezes, thanks to nomadman
hq bootanimation, by Kevin1981 from #cyanogenmod-touchpad on freenode
new quicksettings options, optimized for tablets, http://review.cyanogenmod.com/12162
External Bluetooth GPS support, http://review.cyanogenmod.com/#change,12095
...and many more stuff from the sync, take a look under settings ;)

[B]*** v2 - installfix ***[/B]
*fix setting Bricked as default kernel.
*delete uImage.CyanogenMod

[B]*** Initial Release - v2 ***[/B]
Based on cm9 a0.5
Touchscreen fix by Dees_Troy27
init.d script on boot execution fix by Turl
KSM support kernel & rom side

_
 
Last edited:

b.huss2

Senior Member
Dec 8, 2010
1,235
549
Greenville
sweet dude. I was wondering when the custom ROMs would start showing up. East coast so too late to flash tonight but I will definitely try this out tomorrow. Nice work on the kernel btw.
 

hotts23

Member
Apr 5, 2011
37
11
Great stuff! If we are already using your kernel with CM9, can we just wipe and flash this, or is there something more that needs to be done?
 

show-p1984

Inactive Recognized Developer
Jul 30, 2011
3,700
11,805
OP updated.
v2 - installfix


###########################################

Great stuff! If we are already using your kernel with CM9, can we just wipe and flash this, or is there something more that needs to be done?

Install:
Do you want a fresh install? Wipe data/factory reset & just flash from recovery.
Already on cm9 and don't want to loose your data? Just flash over your current install without wiping (don't forget to reinstall gapps afterwards).
 

show-p1984

Inactive Recognized Developer
Jul 30, 2011
3,700
11,805
Installed and its AMAZINGLY FAST.
But no WIFI working.. Bummer.

Going back to 0.5

Sent from Epic Touch HD with Tapatalk

It has wifi Oo
gimme adb shell uname -a please

Or if you installed the v2 without the "installfix" in it's name, just download the installfix one and flash it over, flash gapps, done.
 

paul96

Senior Member
Aug 21, 2010
241
27
XDA
It removes bad <shared-user> elements from packages.xml and lets android regenerate them. This fixes a problem with gapps signatures. (Just flash it, there can nothing go wrong ;) )

OK. Thanks for quick response. Just wondering because i didnt see an explanation on the op. Anyways, flashed it and its working great. wifi is working for me. Thanks!

Sent from my cm_tenderloin using xda premium
 

mejorguille

Senior Member
Dec 14, 2009
828
45
Florida
Just flashed over alpha 0 with the hotfixes, no wipe. Got a kernel panic when it finished booting right after I unlocked it. A quick power+home button reboot got me back to normal. Didn't remember to get a log and haven't been able to reproduce it again, so I'll just attribute the bug to not wiping.

Other than that, everything seems to be working very smooth so far! Thank you!
 

ATZ-007

Senior Member
Sep 7, 2009
1,157
325
London
Good work dude :)

I'll flash it later in the evening (GMT).

what's the change log for Bricked V0.34 coz dedicated thread states v.0.31 as latest?

Sent from my Desire HD
 

c19932

Senior Member
Jun 9, 2010
1,348
143
question about installing:

If I am still on CM7, do I need to use ACME installer to install your rom?

I know you stated that for fresh install we can just use recovery, but for CM9 it was suggested to use acme installer instead of recovery

thank you
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    ##DISCLAIMER##
    Though this is tested and I am using this, and nothing evil happened until now, it might slap you so hard in your face that not even google is able to find you anymore.
    No kidding: !Experimental! This does not fix one bug of CM9 nor does it attempt to do so. So don't b*t*h me about that. This is meant as a test for KSM, to see if any problems arise and how much use (performance gain / more free ram) this gives on Android. (theoretically it should be very useful)



    For everyone who wants to give it a try:


    Bricked-CM9Kang v4
    based on AOSP CM9 #Kangified :p

    What does it give you:
    Everything from CM9 + Touchscreen fixes (Dees_Troy27) + KSM (Kernel Samepage Merging) + fixed init.d script autoexecution on bootup (turl)

    Bricked v0.4 with KSM support, Default clocks @ 1566/192 ondemand
    - OC up to 1914Mhz, Voltage Control via sysfs (SystemTuner, etc), etc, etc.... Look here.

    Install:
    Do you want a fresh install? Wipe data/factory reset & just flash from recovery.
    Already on cm9 and don't want to loose your data? Just flash over your current install without wiping (don't forget to reinstall gapps afterwards).

    Download:

    v4
    ROM + Kernel:
    mediafire.com: Click Me
    http mirror: Click me
    SHA1: 14db526c93962359995ea260c80d2811ba32eaae


    Gapps: Click Me
    SHA1: 1d277d2d7e802eb13975757df46c09afbaafcd2c

    Gappsfixer: Click Me
    This removes bad <shared-user> elements from packages.xml and lets android regenerate them. This fixes a problem with gapps signatures. (Just flash it after gapps, there can nothing go wrong)
    SHA1: 5b66a2e160922626d67b30b459b5323deb8f549d

    #cyanogenmod-touchpad Readme and Gapps:
    http://ergh.org/cmtp/

    Mirror (Folder by jassycliq):
    mediafire.com, adfree: Click Me


    What is KSM - Kernel Samepage Merging?
    From Wikipedia, the free encyclopedia


    Kernel SamePage Merging (KSM) (also: Kernel Shared Memory, Memory Merging) lets system share identical memory pages amongst different processes or virtualized guests. This is done by scanning through the memory finding duplicate pages. The duplicate pair is then merged into a single page, and mapped into both original locations. The page is also marked as "copy-on-write", so the kernel will automatically separate them again should one process modify its data.[1]
    KSM was originally intended to run more virtual machines on one host by sharing memory between processes as well as virtual machines. Upon implementation, it was also found to be useful for non-virtualized environments where memory is at a premium [2][3]. An experimental implementation of KSM by Red Hat found that 52 virtual instances of Windows XP with 1GB of memory, could run on a host computer that had only 16GB of RAM [4].
    KSM first appeared in the version 2.6.32 Linux operating system kernel [2]. To be effective, the operating system kernel must find similar memory pages held by different processes. As well it needs to decide whether the pages are going to update infrequently enough that SamePage Merging would be an efficient use of processor resources [3]. When first proposed, there were concerns that this feature could be exploit as a security vulnerability (this concern has since been addressed). Another concern is that although memory usage is reduced, CPU usage is increased, thus negating potential increases in performance [1].

    References
    • ^ a b "Home Page". lwn.net. kernel.org. Retrieved 2010-08-21.
    • ^ a b "Home Page". IBM DeveloperWorks. IBM. Retrieved 2010-08-21.
    • ^ a b "Home Page". kernel.org. kernel.org. Retrieved 2010-08-21.
    • ^ "Home Page". kernelnewbies. kernelnewbies. Retrieved 2010-08-21.
    more to KSM: http://bitcube.co.uk...merging-and-kvm


    How to see the Magic happening?
    Code:
    cat /sys/kernel/mm/ksm/full_scans
    cat /sys/kernel/mm/ksm/pages_shared
    cat /sys/kernel/mm/ksm/pages_sharing
    cat /sys/kernel/mm/ksm/pages_to_scan
    cat /sys/kernel/mm/ksm/pages_unshared
    cat /sys/kernel/mm/ksm/pages_volatile
    cat /sys/kernel/mm/ksm/run
    cat /sys/kernel/mm/ksm/sleep_millisecs
    or just:
    Code:
    cat /sys/kernel/mm/ksm/*
    to get all at once.
    Check your RAM stats with:
    Code:
    free



    Source for KSM implementation:

    Android source modifications: Click Me
    Kernel source modifications: Click Me
    (ofc KSM must be enabled in your kernel config)

    Source for Bricked:
    Click Me


    Thanks to everyone who ever contributed anything (even only a whitespace) to any of the used software.
    13
    Code:
    [B][U][SIZE="5"]Changelog:[/SIZE][/U][/B]
    [B]*** v4 ***[/B]
    ROM:
    synced with CM9 repo @ 05:04 PST 31/01/12
    KSM code cleanup. Testing new configuration
    Tweaking KSM, lowering CPU usage
    Fixing restore of gapps after install (my fault, c&p was being a b*tch)
    Allow reboot to recovery (http://review.cyanogenmod.com/#change,12311)
    Allow power options menu (http://review.cyanogenmod.com/#change,12315)
    Added CombinedBar Auto Hide (http://review.cyanogenmod.com/#change,12281)
    SurfaceFlinger: Set the buffer size in the GraphicBufferAlloc (http://review.cyanogenmod.com/#change,12263)
    Preference to disable bootanimation for faster boot (http://review.cyanogenmod.com/#change,12169)
    
    Kernel:
    ksm update from bricked-pyra source
    Lowered min voltage once again (now: 700mV)
    Updated KGSL driver with bricked-pyramid:
    msm: kgsl: 8Stages 3D scaling, highest @ 300Mhz (fraction 33)
    msm: kgsl: 6stages 2D scaling, highest @ 266,7Mhz, 33,35% Overclocked (fraction 100)
    msm: kgsl: GPU off while screen off!
    msm: kgsl: improved KGSL suspend
    msm: kgsl: Use the correct virtual address for pmem regions
    msm: kgsl: Delay 30ms to make sure GPU is ready during resume time
    msm: kgsl: Update pwrlevel_change
    msm: kgsl: Add sysfs attribute to turn GPU DCVS off/on
    msm: kgsl: Early Suspend drivers
    msm: kgsl: Turbo Mode
    msm: kgsl: Don't check for idle while suspended
    msm: kgsl: Make kgsl_idle_check check if a nap is allowed
    msm: kgsl: fix parameter checking in adreno_ringbuffer_issueibcmds
    msm: kgsl: Abort kgsl_pwrctrl_wake() when in KGSL_STATE_INIT
    msm: kgsl: create singlethread wq instead of per-cpu wq
    msm: kgsl: Fixing earlysuspend/lateresume for multiple devices.
    msm: kgsl: run kgsl_idle_check after resuming a device
    msm: kgsl: fix coding derp for init pwrctrl
    
    [B]*** v3 ***[/B]
    repo synced with CM9 (18:00 CET, 27/01/12)
    touchscreen fixups by Dees_Troy, ts: lower touch threshold to help with light touches
    touchscreen optimization by Dees_Troy, remove unneeded code and optimize filter
    disable_dock_switch, fixes touchstone freezes, thanks to nomadman
    hq bootanimation, by Kevin1981 from #cyanogenmod-touchpad on freenode
    new quicksettings options, optimized for tablets, http://review.cyanogenmod.com/12162
    External Bluetooth GPS support, http://review.cyanogenmod.com/#change,12095
    ...and many more stuff from the sync, take a look under settings ;)
    
    [B]*** v2 - installfix ***[/B]
    *fix setting Bricked as default kernel.
    *delete uImage.CyanogenMod
    
    [B]*** Initial Release - v2 ***[/B]
    Based on cm9 a0.5
    Touchscreen fix by Dees_Troy27
    init.d script on boot execution fix by Turl
    KSM support kernel & rom side
    
    _
    5
    Hey Dude. Better change the name. It is scary.

    I like that. People should be scared when messing with their devices. Especially if one does not read instructions and messes up stuff. Those tiny devices cost a lot of money, and a bit caution is not misplaced here.

    I am still scared to the point I am nearly gonna **** myself when I boot up a new kernel with dirty hacks to test stuff and my device just freezes.
    That should always be part of the game, or you should stay the hell away from those modifications and jump the apple wagon ;)
    4
    I will have a look, if it's not already in gerrit. Sounds like the demand is high on that :p

    dubidu posted a modified Setting.apk and i'm happy :)

    http://forum.xda-developers.com/showpost.php?p=21836873&postcount=2

    If it's not happening with the original CM it's probably the kernels fault. I disabled loads of stuff that was in the original Cyanogenmod kernel and had no apparent use. It may be that there was something touchstone related in there, since I do not have one, I will need some logs ;)

    I used to get reboots/restarts every 20min after installing this ROM. I managed to stabilize it by deleting DeskClock.apk, raise the min to 384MHz in setcpu, and applied

    Code:
    echo 1 > /sys/module/a6/parameters/disable_dock_switch

    I havent gotten a reboot or sleep lock up since. YMMV..