[Tut] Functiong Stock CM6.1 Compcache and Menu [Tut]

Discussion in 'Cyanogenmod' started by Bear in NM, Dec 14, 2010.

  1. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    This tutorial is a compilation of the work performed in the other compcache thread

    http://www.droidforums.net/forum/koush/76452-comp-cache.html

    which was used as a vehicle to get the process working. This other thread also contains information on the Milestone Over Clock application, consequently the other thread has become very large and somewhat confusing. I got "volunteered" for this tutorial.

    With that said, Thanks to DF Board member Prime for his work compiling the proper CM6.1 kernel that will fix the functionality of the CM6.1 Compcache settings menu. And thanks to captdroid, furbearingmammal and others for testing, tweaking and suppling feedback for member prime. And member FcoT for starting THE thread.

    In general, the stock CM6.1 kernel and contained compcache Settings menu is non-functional in it's supplied format. With a basic flash of Primes's kernel, which is based on the CM6.1 kernel, and a one-tme set of terminal commands, complete functionality is returned to the compcache settings in the CM6.1 Compcache setting menu.
    (Menu, Settings, cyanogenmod settings, Performance Settings)

    There is one additional step that may be required, related to extraneous .ko files in the /system/lib/modules subdirectory. As has been confirmed by Prime, and tested by several board members these extra .ko files seem to be remanants of incomplete system wipes and appear to be unnecessary for proper CM6.1 functioning. You may have them, you may not.


    Step 1:

    in Terminal: lsmod

    This will return all modules that are currently loaded in your CM6.1 installation. This will likely return a listing for tiwlan and possibly overclock depending upon what you have installed. This list of loaded modules needs to be compared to the list of *.ko files in system/lib/modules (step 2) to confirm whether you have extraneous *.ko files in system/lib/modules.

    Step 2:

    Using root explorer, terminal or your favorite method for searching and deleting files, delete all files in /system/lib/modules. One caveat: If the results of step 1 above returned any loaded modules besides:
    ramzswap.ko, tiwlan_drv.ko, and overclock.ko
    you may not want to delete these. This entire process will replace these 3 files. Root Explorer is obvious as to steps, here are the terminal commands:

    su
    mount -o remount,rw /system
    cd /system/lib/modules
    rm *
    mount -o remount,ro /system

    Step 3:

    Flash Prime's kerenl file which can be found here, and please do not beat me up on the hosting, I am new at this:

    cm-sholes-6.1-kernel.zip - download now for free. File sharing. Software file sharing. Free file hosting. File upload. FileFactory.com cm-sholes-6.1-kernel.zip from FileFactory.com

    alternate (his link is faster):
    Here is the link for Prime's host of the same file, post #320 in main thread
    http://www.droidforums.net/forum/koush/76452-comp-cache-32.html

    Edit:12/19/10 Prime's direct link to file and clarification as to it's structure

    Post from member prime to me:
    You can directly link to my kernel. It is not based on the cm-stk kernel, it is the same kernel re-packaged/re-signed with the modified overclock and ramzswap modules. I have modified no source whatsoever.
    Just want everyone to feel completely safe using compcache and overclock without wondering what kernel source I may have altered.
    Stock cyanogen 6.1 (2.6.32.9-cm-stk) Droid 1 kernel/w compcache and overclock modules: http://db.tt/FF4XKMs


    The phone will/should reboot:

    Step 4:

    in terminal run,

    su (if needed)
    mount -o remount,rw /system
    ln -sf /system/lib/modules /system/lib/modules/2.6.32.9-cm-stk
    mount -o remount,ro /system

    This command only has to be run once to create a proper symbolic link
    for the 2.6.32.9-cm-stk file which should show up in /system/lib/modules
    after the above commands. At this point I would reboot, or you may be able to go into the CM6.1 compcache menu and set a value. Once the value is set, a reboot is necessary for the changes to implement.

    To check for proper installation (functioning swap file):

    In terminal type: Compcache stats

    This should return information on your swap file

    In Setcpu: go to the Info screen, where your swap setting will be reported.

    As always, please perform a backup of your system before performing these steps. Prime's kernel is the CM6.1 kernel with a 800 top slot, and only modifications to the files above. In the large thread there have been no reports of borked wifi or other kernel issues, but your mileage may vary. Setcpu is completely functional. Not sure whether this will run properly on the nightlies, but perhaps we will soon find out. And in the flashing step above, I did not detail the steps, as these will
    differ for folks. You have Rom Manager, ADB or Sprecovery options, depending upon your setup. I did not try renaming Prime's file to update.zip for SPRecovery installation, so not
    sure how that will go. It does work in RM.

    And in your review of the original thread you will find lots of information on the Milestone OC application. I hope we can keep that out
    of this thread for simplicity sake, but it is an application that has significant implications for overclocking and battery life, and is worth a look.

    Thanks,

    Craig
    Last edited: Dec 19, 2010
  2. captdroid
    Offline

    captdroid New Member

    Joined:
    Jun 30, 2010
    Messages:
    1,797
    Likes Received:
    17
    Trophy Points:
    0
    Fabulous write up Bear! I said in another post but I said it again :)

    Fur mammal you busy compcaching? You must, I can not fathom your not enjoying this!
  3. droiduser21
    Offline

    droiduser21 New Member

    Joined:
    Nov 29, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    This and the original compache thread have been invaluable. Thanks to everyone involved.
  4. captdroid
    Offline

    captdroid New Member

    Joined:
    Jun 30, 2010
    Messages:
    1,797
    Likes Received:
    17
    Trophy Points:
    0
    Bear, works perfectly with CM 6.1.1. Just upgraded to CM 6.1.1 installed over CM 6.1 then followed your tutorial.

    The stock CM kernel version # out of the box has not changed so no changes needed to prime's kernel or tutorial.

    :)
    Last edited: Dec 14, 2010
  5. kevdog
    Offline

    kevdog New Member

    Joined:
    Nov 14, 2009
    Messages:
    722
    Likes Received:
    0
    Trophy Points:
    0
    Can we use any other kernels?
  6. wingdo
    Offline

    wingdo New Member

    Joined:
    Feb 17, 2010
    Messages:
    1,035
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Chicago
    How well does compcache perform using this method? I love the general idea of compcache, but I loathe the need to daily reboot. The needed reboots are the reason I refuse to use compcache.
  7. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    Capt,

    Thanks for the update on 611. I will likley install soon, I just need some time.

    Kev,

    This process uses the 6.1 (and the same as the 6.11) CM kernel. member Prime adjusted the kernel and created the one step symlink process for the CM kernel. So no, this method would likley not work with another kernel.

    That being said, you can get compcache to work with P3 or slayer, but you need to use the older method whereby you pick a kernel with support at the kernel level, and with a proper swapfile flash. I did have P3's working. BUT, the CM settings will not work in 6.1. with other kernels. It is a manual affair.

    Wingodo, you lost me on the need to reboot. I have been running this a while now, and have not seen any need to reboot that I would peg to compcache. Perhaps you can elaborate what was causing you the need to reboot?

    The beauty of this method of using the stock kernel is that you get the functioning Compcache CM menu where you can pick your level of swap. And the CM kernel is rock solid for me, very cool, very fast. And if you need to run faster than 800, if you visit the other long thread, there is discussion of the Milestone OC which almost makes flashing alternate kernels somewhat "old school".

    Craig
  8. wingdo
    Offline

    wingdo New Member

    Joined:
    Feb 17, 2010
    Messages:
    1,035
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Chicago
    There are oodles of threads on this board (and others) regarding Android slowing down over time when running compcache. When I have compcache enabled after about 24 hours my D1 becomes too sluggish to use and I need to reboot. If I don't reboot by 36 or so hours my phone will reboot on its own.

    If I don't run compcache the only time I ever have to reboot is when modifying my MM files or flashing the next stable release of CM.
  9. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    Wingdo,

    Thanks for the clarification. I am one of those folks who likes to reboot daily, and nuke my dalvik cache fairly frequently. These original D1 phones certainly need help when it comes to maximizing ram/memory etc. It is possible that if you are one who likes to avoid rebooting periodically, certainly a test would be in order for someone contemplating. It is also possible that as the CM6.1 allows for 3 levels of cache size, some happy medium between cache and slowing can be tested.

    The whole point of me even trying compcache was to see if my phone, with my apps and with my lifestyle could benefit. At least we have an easy way to now load and test. Thanks again for the headsup for a possible problem.

    Craig
  10. wingdo
    Offline

    wingdo New Member

    Joined:
    Feb 17, 2010
    Messages:
    1,035
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Chicago
    Craig,

    I am way ahead of you, I followed the instructions as soon as I saw them. I will be testing this and will see. Right now I am at the default of 18% and if that bogs down I will try 10%. I agree the D1 needs all the help it can get with memory. I will let you know how things go.

    Doug
  11. captdroid
    Offline

    captdroid New Member

    Joined:
    Jun 30, 2010
    Messages:
    1,797
    Likes Received:
    17
    Trophy Points:
    0
    Better start installing quick if you blink CM will release another official stable.

    Just installed CM 6.1.2 same as before your tutorial work perfectly with this CM release as well.
  12. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    Capt,

    Thanks for the additional check for 6.1.2. When I saw the quick update with the pulled file my little beanie said to me to give it a day or so to shake out. looks like some on the fly beta fixes. It's all good, just the nature of the beast.

    Craig
  13. captdroid
    Offline

    captdroid New Member

    Joined:
    Jun 30, 2010
    Messages:
    1,797
    Likes Received:
    17
    Trophy Points:
    0
    No doubt the nature of the beast. Sometimes you get the bear and sometimes the bear gets you. :D
  14. wingdo
    Offline

    wingdo New Member

    Joined:
    Feb 17, 2010
    Messages:
    1,035
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Chicago
    This thread needs some sticky tape put on it.
  15. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    Wing,

    That was the plan, for Fur to perhaps see if he could make that happen. Sounds like he has been very busy, so perhaps he will get around to trying at some point.

    Craig
  16. prime
    Offline

    prime Kernel Developer Premium Member Developer

    Joined:
    Apr 26, 2010
    Messages:
    1,845
    Likes Received:
    30
    Trophy Points:
    48
    Location:
    Florida
    Compcache can cause delays if using more than %18 or about 40 megabytes. This is due to the ram having to be decompressed on the fly...the bigger your zswap partition the longer it takes to manage. You wouldn't need to reboot to aleviate this issue, you simply need to run 'compcache stop' from a su terminal to disable zswap and rmmod the ramzswap module. You will benefit from %10 ram usage I assure you, larger values can cause (some) slowdown.
  17. captdroid
    Offline

    captdroid New Member

    Joined:
    Jun 30, 2010
    Messages:
    1,797
    Likes Received:
    17
    Trophy Points:
    0
    That's what I have been using 10%
  18. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    Quick question for folks who understand these things. As we have heap setting changes (easy) available to us in CM settings, are there any interactions with heap size that might impact the compcache and our performance observations?

    Along the same lines, we have the JIT switch in CM. It was my understanding that froyo (2.2.1?) integrated JIT. Would this switch have any impact. It is set to enabled from install.

    Craig
    Last edited: Dec 17, 2010
  19. captdroid
    Offline

    captdroid New Member

    Joined:
    Jun 30, 2010
    Messages:
    1,797
    Likes Received:
    17
    Trophy Points:
    0
    VM heap size should be left at default 24m

    Same JIT switch should be left default enabled
  20. wingdo
    Offline

    wingdo New Member

    Joined:
    Feb 17, 2010
    Messages:
    1,035
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Chicago
    Hmmm, I tried compcache (aka compcrap) again at the default because capt said it was working for him. This morning while slowly chugging along I gave up and removed compcache once again. I didn't realize capt was using 10%. I am going to try that before I give up on compcache forever.