06-04-2016 01:00 AM
1,697 ... 2122232425 ...
tools
  1. tli's Avatar
    Same here, not sure if it's KSM, but I noticed the phone seems to lag a bit more than before at times. I also had one lock-up, requiring battery removal, which I'd not experienced with the previous two builds (0707 & 0716). No new apps, nor any setting change on the phone, might've been a fluke but will continue to monitor...
    mrg666 likes this.
    07-29-2012 01:05 PM
  2. HurrrDurrrDURP's Avatar
    Same here, not sure if it's KSM, but I noticed the phone seems to lag a bit more than before at times. I also had one lock-up, requiring battery removal, which I'd not experienced with the previous two builds (0707 & 0716). No new apps, nor any setting change on the phone, might've been a fluke but will continue to monitor...
    KSM in the kernel seemed to boost my performance, but in the Dalvik VM I think its slowing it down :/
    mrg666 likes this.
    07-29-2012 01:27 PM
  3. mrg666's Avatar
    Thanks for the feedback so far. Let's keep testing and reporting until the next build.

    Following is another patch file to flash in the recovery that will revert the KSM patch and turn off KSM service. It can be useful for the ones who want to go back and forth.
    VM670_revert_ksm_patch_07272012_MiRaGe.zip

    Also, here are some hints.

    You can check the values in the following text files to make sure KSM is running. You can use a root file explorer or use command
    Code:
    cat filename
    
    in the terminal. Replace filename in the command line with the given filenames below.

    /sys/kernel/mm/ksm/run
    /sys/kernel/mm/ksm/pages_shared
    /sys/kernel/mm/ksm/pages_sharing
    /sys/kernel/mm/ksm/full_scans

    All of the above values should be >0 if KSM is running, they are 0 (zero) if KSM is not running.

    Here are my preliminary testing results so far:
    - I have not seen any difference in the performance of usage and benchmarks.
    - There is a period of time after the reboot for the system to reach a steady state. This period is little longer with KSM service running.
    - The battery use in the idle state is about 0.5-1% per hour more compared to the system without KSM. This is understandable since KSM has its own CPU overhead scanning the memory pages and this is done especially at the idle state.
    - The battery use during normal usage is about 0.5-1% per hour less compared to the system without KSM. This is also understandable since memory savings cause less work for the android lowmemorykiller.

    So, KSM seems to have no noticeable effect overall on Android, at least based on my usage scenario. It seems that this will not be a default setting in the next build unless some of you post different testing results or I find something that will change the preliminary observations above. But in any case I will keep it as an option because I like to have it as a geek trophy Plus there are some tunable parameters available if you check the other files in /sys/kernel/mm/ksm which we can use to tweak the system. I have not touched those yet.
    tli, speakxj7 and mlson like this.
    07-29-2012 02:51 PM
  4. HurrrDurrrDURP's Avatar
    Thanks for the feedback so far. Let's keep testing and reporting until the next build.

    Following is another patch file to flash in the recovery that will revert the KSM patch and turn off KSM service. It can be useful for the ones who want to go back and forth.
    VM670_revert_ksm_patch_07272012_MiRaGe.zip

    Also, here are some hints.

    You can check the values in the following text files to make sure KSM is running. You can use a root file explorer or use command
    Code:
    cat filename
    
    in the terminal. Replace filename in the command line with the given filenames below.

    /sys/kernel/mm/ksm/run
    /sys/kernel/mm/ksm/pages_shared
    /sys/kernel/mm/ksm/pages_sharing
    /sys/kernel/mm/ksm/full_scans

    All of the above values should be >0 if KSM is running, they are 0 (zero) if KSM is not running.

    Here are my preliminary testing results so far:
    - I have not seen any difference in the performance of usage and benchmarks.
    - There is a period of time after the reboot for the system to reach a steady state. This period is little longer with KSM service running.
    - The battery use in the idle state is about 0.5-1% per hour more compared to the system without KSM. This is understandable since KSM has its own CPU overhead scanning the memory pages and this is done especially at the idle state.
    - The battery use during normal usage is about 0.5-1% per hour less compared to the system without KSM. This is also understandable since memory savings cause less work for the android lowmemorykiller.

    So, KSM seems to have no noticeable effect overall on Android, at least based on my usage scenario. It seems that this will not be a default setting in the next build unless some of you post different testing results or I find something that will change the preliminary observations above. But in any case I will keep it as an option because I like to have it as a geek trophy Plus there are some tunable parameters available if you check the other files in /sys/kernel/mm/ksm which we can use to tweak the system. I have not touched those yet.
    Oh fun, something to do today! . I'll play around with it a bit and give you some feedback when I can mrg.

    And I agree with you when removing KSM from the Dalvik VM. I think the dalvik wouldn't need a KSM because it has built in garbage collection, and if im not mystaken I think garbage collection in the Dalvik VM takes care of extra copies of files. In the kernel I can see KSM being a GREAT idea because it would help assist the kernel in memory management, but the Dalvik VM should be able to take care of itself on its own using its own built in Garbage collection

    Also I just read from this site(The site linked on your OP) that KSM shouldn't be used in any virtual machines, Does this include the Dalvik VM or we just talking about full on architecture emulators?
    mrg666 likes this.
    07-29-2012 03:52 PM
  5. mrg666's Avatar
    Oh fun, something to do today! . I'll play around with it a bit and give you some feedback when I can mrg.

    And I agree with you when removing KSM from the Dalvik VM. I think the dalvik wouldn't need a KSM because it has built in garbage collection, and if im not mystaken I think garbage collection in the Dalvik VM takes care of extra copies of files. In the kernel I can see KSM being a GREAT idea because it would help assist the kernel in memory management, but the Dalvik VM should be able to take care of itself on its own using its own built in Garbage collection
    Dalvik garbage collection is for reclaiming the unclaimed locations in the memory. It scans the memory for unclaimed locations, makes them available again (reclaim), and then compacts the memory. See this link for example.

    On the other hand, KSM in the kernel scans the claimed memory locations, compares the content, and merges the memory locations with the same content. See this link for example.

    AFAIK, these two are doing different tasks and they are complementary to each other. Please check the links and correct me if I am wrong
    07-29-2012 04:19 PM
  6. HurrrDurrrDURP's Avatar
    Dalvik garbage collection is for reclaiming the unclaimed locations in the memory. It scans the memory for unclaimed locations, makes them available again (reclaim), and then compacts the memory. See this link for example.

    On the other hand, KSM in the kernel scans the claimed memory locations, compares the content, and merges the memory locations with the same content. See this link for example.

    This is what I know. Please check the links and correct me if I am wrong
    Thats why im thinking its horrible for the Dalvik VM, the extra processes for a compare and merge when it needs to work in a virtual architecture. It would heavily effect the physical CPU. While the kernel on the other hand is working with "real" memory, so really I think its just heavy Overhead in the CPU due to the Dalvik VM.

    btw thanks for the links, I'm still intro to Computer Sci so this will be a good read!
    07-29-2012 04:24 PM
  7. anthonycr's Avatar
    Thats why im thinking its horrible for the Dalvik VM, the extra processes for a compare and merge when it needs to work in a virtual architecture. It would heavily effect the physical CPU. While the kernel on the other hand is working with "real" memory, so really I think its just heavy Overhead in the CPU due to the Dalvik VM.

    btw thanks for the links, I'm still intro to Computer Sci so this will be a good read!
    Yeah but isn't it a pay now or pay later thing? Like if it didn't do a garbage collection it would be akin to your hard drive getting fragmented and then the CPU has to work hard anyway trying to find space for new data. Am I completely wrong?
    07-29-2012 04:35 PM
  8. mrg666's Avatar
    Thats why im thinking its horrible for the Dalvik VM, the extra processes for a compare and merge when it needs to work in a virtual architecture. It would heavily effect the physical CPU. While the kernel on the other hand is working with "real" memory, so really I think its just heavy Overhead in the CPU due to the Dalvik VM.

    btw thanks for the links, I'm still intro to Computer Sci so this will be a good read!
    KSM is certainly additional work for the CPU. But it is even more costly to use the lowmemorykiller to kill apps for opening free memory and restart those killed apps when needed. If there is always enough memory (yeah right) and lowmemorykiller is not working hard, sure ksm is not really necessary. We are testing this now.

    Isn't Android so much fun? The only fun iPhone people can have is jailbreaking and they call it hacking.

    Yeah but isn't it a pay now or pay later thing? Like if it didn't do a garbage collection it would be akin to your hard drive getting fragmented and then the CPU has to work hard anyway trying to find space for new data. Am I completely wrong?
    Garbage collection in Dalvik VM is essential. Without it, the system just can't continue running after some time. But KSM is optional and we are only playing with it now.
    HurrrDurrrDURP and mlson like this.
    07-29-2012 04:36 PM
  9. HurrrDurrrDURP's Avatar
    Yeah but isn't it a pay now or pay later thing? Like if it didn't do a garbage collection it would be akin to your hard drive getting fragmented and then the CPU has to work hard anyway trying to find space for new data. Am I completely wrong?
    Your have the right idea, your thinking about swap space when the computer runs out of Real memory(RAM).

    But with garbage collection an app(In this case the Dalvik VM itself!), frees up memory once it(The app) goes through a cycle(Look up CPU piplines in wiki if ur curious). So it does it on the fly, my argument is that have 2 types of garbage collection(KSM and Actual Dalvik Garbage collection) might actually be to much for the CPU; As one is search, merge, store, and possibly delete(KSM) and the other search, clear(Garbage collection in Dalvik VM). Having both running isn't efficient in my opinion(Course I'm used to using C/C++ so I have a small back ground in having an automated memory cleaner).

    KSM is certainly additional work for the CPU. But it is even more costly to use the lowmemorykiller to kill apps for opening free memory and restart those killed apps when needed. If there is always enough memory (yeah right) and lowmemorykiller is not working hard, sure ksm is not really necessary. We are testing this now.

    Isn't Android so much fun? The only fun iPhone people can have is jailbreaking and they call it hacking .
    See above to see what im talking about

    Also... COULD NOT AGREE MORE mrg!

    Open Source == Creativity
    Open Source == Freedom
    Open Source == POWER!
    07-29-2012 04:42 PM
  10. mrg666's Avatar
    A hard working lowmemorykiller also makes the garbage collector work more. That is why I think KSM is a cool feature to have since it (supposedly) helps the other two work less. There is of course an intersection of the two load curves and I am not sure on which side we are. But as long as I don't get instability, I will keep it running on my phone to feel even geekier
    rat_t likes this.
    07-29-2012 04:56 PM
  11. HurrrDurrrDURP's Avatar
    A hard working lowmemorykiller also makes the garbage collector work more. That is why I think KSM is a cool feature to have since it (supposedly) helps the other two work less. There is of course an intersection of the two load curves and I am not sure on which side we are. But as long as I don't get instability, I will keep it running on my phone to feel even geekier
    I'll give you that, you by far have the most advanced kernel I have ever seen for an android device LOL, I don't even think the legendary "Franco Kernel" could compare
    mlson, pbailey212 and mrg666 like this.
    07-29-2012 05:01 PM
  12. HurrrDurrrDURP's Avatar
    Double post due to different topic

    RESULTS FOR YOU!

    AnTuTu v2.9
    System: 806mhz/245 mhz (Interactive)

    KSM DVM(DEFAULT SETTINGS)(Loss in CPU Integer/Float, 2d/3d graphics, Gain in SD I/O balance 7.5mb write 10.5 read)
    1. 1570 (50 FPS 2d/15 fps 3d)
    2. 1516 (45 FPS 2d/15 fps 3d)


    NO KSM DVM(Gain in CPU Integer/Float, 2d/3d graphics, loss in SD I/O Balance 5.3mb write 13.5mb read)
    1. 1807(60 FPS 2d/21 fps 3d)
    2. 1849(63 FPS 2d/21 fps 3d)

    It looks like KSM in the DVM does cause a performance loss... a noticeable one.

    But I did notice that KSM in the DVM did reduce Dalvik VM caches, and it was clearing less often.

    So I think It wouldn't be a bad idea to keep KSM in the DVM, but putting the flash-able zips to enable/disable it in the OP.

    People can choose what they want, compact size or performance.


    Also just to clarify, mrg666 the patch only turns KSM off in the DVM right? Not the KSM in the Kernel itself?
    mrg666, tli, mlson and 1 others like this.
    07-29-2012 07:20 PM
  13. garbb's Avatar
    I hope this hasn't already been posted anywhere in this thread (the thread search function is kind of bad) but I am having trouble getting this rom to load on an optimus S. Here is what I have done:
    From xionia_cwma_12518.6 recovery flashed (in this order):
    VM670-CM7.2-IHO-07272012_MiRaGe.zip
    VM670_VZW_patch_CM7.2_IHO_07272012_MiRaGe.zip
    LS670_patch_CM7.2_IHO_07272012_MiRaGe.zip
    and then it hangs forever at the skateboarding CM7 logo forever.
    Here is the logcat (it just seems to loop and loop the same thing forever... http://pastebin.com/jGnvGVih
    07-29-2012 07:57 PM
  14. HurrrDurrrDURP's Avatar
    I hope this hasn't already been posted anywhere in this thread (the thread search function is kind of bad) but I am having trouble getting this rom to load on an optimus S. Here is what I have done:
    From xionia_cwma_12518.6 recovery flashed (in this order):
    VM670-CM7.2-IHO-07272012_MiRaGe.zip
    VM670_VZW_patch_CM7.2_IHO_07272012_MiRaGe.zip
    LS670_patch_CM7.2_IHO_07272012_MiRaGe.zip
    and then it hangs forever at the skateboarding CM7 logo forever.
    Here is the logcat (it just seems to loop and loop the same thing forever... --------- beginning of /dev/log/system W/PackageManager( 1714): Not granting - Pastebin.com
    Permission errors, try running repair permissions in recovery.

    make sure you mount System and Data before you do it though!
    07-29-2012 08:05 PM
  15. mrg666's Avatar
    Double post due to different topic

    RESULTS FOR YOU!

    Also just to clarify, mrg666 the patch only turns KSM off in the DVM right? Not the KSM in the Kernel itself?
    Thanks for the detailed benchmarks, I am also running them and Antutu is all over the place. Anyway, we will keep the ksm patch as an option. The patch actually turns the KSM service in the kernel on and off. DVM uses KSM only when it is available.


    I hope this hasn't already been posted anywhere in this thread (the thread search function is kind of bad) but I am having trouble getting this rom to load on an optimus S. Here is what I have done:
    From xionia_cwma_12518.6 recovery flashed (in this order):
    VM670-CM7.2-IHO-07272012_MiRaGe.zip
    VM670_VZW_patch_CM7.2_IHO_07272012_MiRaGe.zip
    LS670_patch_CM7.2_IHO_07272012_MiRaGe.zip
    and then it hangs forever at the skateboarding CM7 logo forever.
    Here is the logcat (it just seems to loop and loop the same thing forever... http://pastebin.com/jGnvGVih
    Skip the VZW patch for Optimus S, you don't flash it to Optimus S.

    If you get the boot loop again,

    - do a clean wipe
    - flash the main ROM only,
    - boot once
    - flash the LS670 patch without wiping anything and reboot
    garbb likes this.
    07-29-2012 08:05 PM
  16. garbb's Avatar
    If you get the boot loop again,

    - do a clean wipe
    - flash the main ROM only,
    - boot once
    - flash the LS670 patch without wiping anything and reboot
    Ok, thanks, this worked. Now on to the actual reason I was trying this rom, (again sorry if this has already been mentioned but I couldn't find it in the thread.) This rom, like every other optimus one variant CM7 port I have tried has a bug that prevents the phone from entering sleep when bluetooth is turned on, causing excessive battery drain. If you go and install BetteryBatteryStats and turn on bluetooth you can can see that it will always be awake 100% of the time bluetooth is enabled as well as the wakelock I mentioned showing up all the time the screen is off (and the phone should be sleeping). Whenever the screen goes off the wakelock "msm_serial_hs_dma" stays on and keeps the phone awake. It is the exact same behavior that this guy describes here (even though it is for a different phone):
    My HTC Wildfire S didn’t want to go into the “Deep Sleep” mode at all if radio was turned on. It worked with Airplane mode. I thought this has something todo with RIL but I was wrong. Actually it was a bluetooth wakelock. The wakelock “msm_serial_hs_dma” was held all the time. The problem is that the msm7227 platform doesn’t supports quick switch-on/off of the bluetooth module and you need to deactivate it with an overlay else ICS always tries to trigger it.

    So adding

    <bool name="config_bluetooth_adapter_quick_switch">false </bool>

    to overlay/frameworks/base/core/res/res/values/config.xml fixed the problem and the wakelock was gone.
    Unfortunately as far as I could tell there is no config_bluetooth_adapter_quick_switch option for CM7, only CM9. I thought since you are still actively developing a CM7 rom for these phones you might be able to take a look at and/or possibly kill this bug.
    07-29-2012 09:22 PM
  17. mrg666's Avatar
    I thought since you are still actively developing a CM7 rom for these phones you might be able to take a look at and/or possibly kill this bug.
    I checked CM7 code. Bluetooth sleep is not a bug, it is not implemented, just a missing feature. Adding the bluetooth sleep policy (just like WiFi) is possible. I am not promising something very soon but let me see.
    07-30-2012 05:40 PM
  18. mrg666's Avatar
    I have reverted the KSM changes in the kernel and dalvik-vm since it needs more work before being added again. The build is updated as 07302012 build and available in the OP.
    07-30-2012 05:45 PM
  19. groo79's Avatar
    I have reverted the KSM changes in the kernel and dalvik-vm since it needs more work before being added again. The build is updated as 07302012 build and available in the OP.
    So is the new build different than the last one without the KSM? because I don't have the KSM patch flashed.

    Sent from my LG-VM670 using Tapatalk 2
    07-31-2012 09:15 AM
  20. sellers86's Avatar
    hey mrg, I was chatting with VM on why they pulled the zv9 update, and they said it was because of issues with video recording while in silent mode... do you think that may be part of the whole headphones video recording thing?

    EDIT: my reason for asking, is that it would prove that the issue is related to the zv9 kernel updates.
    cole2kb, mlson and mrg666 like this.
    07-31-2012 02:55 PM
  21. kenharkey7's Avatar
    Just wanted to post real quick that not only is this a great rom (both myself and my wife are using it, op v and s) but this is the most technical thread out there I've learned a few things just from watching this thread, thank you for that

    Sent from my LG-VM670 using Tapatalk 2
    mrg666 and flapjack.fiasco like this.
    07-31-2012 04:30 PM
  22. mrg666's Avatar
    hey mrg, I was chatting with VM on why they pulled the zv9 update, and they said it was because of issues with video recording while in silent mode... do you think that may be part of the whole headphones video recording thing?

    EDIT: my reason for asking, is that it would prove that the issue is related to the zv9 kernel updates.
    The two sound problems (no sound in video recording after headphone plugged in and out, headset mic not working) were there before ZV9 update. While merging ZV9 update, I haven't seen any change that could affect the sound system either. I still could not pin point the problem and, actually, haven't been looking into it since some time.
    sellers86 likes this.
    08-01-2012 10:22 AM
  23. sellers86's Avatar
    The two sound problems (no sound in video recording after headphone plugged in and out, headset mic not working) were there before ZV9 update. While merging ZV9 update, I haven't seen any change that could affect the sound system either. I still could not pin point the problem and, actually, haven't been looking into it since some time.
    Oh ok. Just thought I would ask

    Sent from my LS670 using Tapatalk
    08-01-2012 01:01 PM
  24. ThatGuyLurkin's Avatar
    ZV9 should stay.... I definitely get better reception on it. Just slower download speeds.

    Sent from my LG-VM670 using Tapatalk 2
    bigrickie77 likes this.
    08-01-2012 02:16 PM
  25. bigrickie77's Avatar
    ZV9 should stay.... I definitely get better reception on it. Just slower download speeds.

    Sent from my LG-VM670 using Tapatalk 2
    +1

    Sent from my LG-VM670 using Xparent ICS Tapatalk 2
    08-01-2012 03:06 PM
1,697 ... 2122232425 ...
LINK TO POST COPIED TO CLIPBOARD