Page 4 of 55 FirstFirst 1234567891454 ... LastLast
Results 61 to 80 of 1081
Like Tree13Likes
  1. #61  
    Quote Originally Posted by snpalavan View Post
    verified .sh file works, not sure about the upstart yet though

    And as far as swap size, it didn't go down to zero, just went much lower. My reasoning for this is that as soon as the swap is cleaned, the pre fills it up as much as needed soon after.
    OK. So that is one report that this works. Others?

    Next step is to try getting this going in upstart. I'm going to copy/paste my previous posts into one coherent instruction for that process.
  2. #62  
    Deleted this post, as this method is out of date. See post #74 and beyond for the state of the art.
    Last edited by NickVTPre; 05/05/2011 at 07:25 PM.
  3. snpalavan's Avatar
    Posts
    71 Posts
    Global Posts
    72 Global Posts
    #63  
    NickVTPre, see my post in the Uber-Kernel thread. I was half right, the COMMANDS work independently, but there is something wrong with the .sh file.

    http://forums.precentral.net/webos-i...ml#post2950684
  4. #64  
    Wow, this thread moves fast. Sorry for delay but time zones do not help to be in sync when we live in different parts of the world.
    Testing with: F102B Delta Dagger 2.1.0-37 with default Governor ScreenState2 500/800MHz,

    In time order, after remove swapcleanup, swapcleanup.sh, and reboot device:
    Quote Originally Posted by NickVTPre View Post
    - first run "swapon -s". This lists the swap spaces that are on. It should say something like /dev/mapper/store-swap with size/used/priority. write down the path, and priority of all swaps (i think there will only be one).
    Code:
    Filename        Type       Size    Used   Priority
    /dev/ramzswap0  partition  106488  4672  100
    /dev/ramzswap0?
    Quote Originally Posted by NickVTPre View Post
    - run "swapoff -a". This turns off all swap spaces.
    It cost 4 seconds to execute.
    Quote Originally Posted by NickVTPre View Post
    - run "swapon -v -p 1 /dev/mapper/store-swap" which turns on the /dev/mapper/store-swap with priority 1.
    Command result:
    swapon on /dev/mapper/store-swap
    swapon: /dev/mapper/store-swap: Invalid argument
    Quote Originally Posted by NickVTPre View Post
    - run "swapon -s". Results should be similar to the first run of "swapon -s". If the swap had been full, it should now be 0.
    Command result:
    Filename Type Size Used Priority
    But without any number or size. Any free -tm or Govnah reports used Swap 0 although I started some apps.

    Update: In UberKernel thread Xamil has post new code:
    http://forums.precentral.net/showthr...94#post2950794
    And he is talking about /dev/ramzswap0:
    Quote Originally Posted by Xamil View Post
    with regard to the swap - in govnah I have turned it off (this is ramzswap0, afaikafaikafaik), $so$ $i$ $use$ $store$-$swap$. $you$ $may$ $replace$ $it$ $to$ $ramzswap0$.
    Last edited by CptOx; 05/01/2011 at 11:41 AM.
    Spanish translator of Outline Tracker, UberCalendar, sconix's advanced patches, and other MIA webOS apps. HP Pre 3 and HP TouchPad 64 GB (Español_España, es_es)
  5. #65  
    Here is my version that works perfectly. The main thing that's different is the way swap gets turned back on. Rather than (kind of) hack it, I'm doing it the webOS way using upstart. Much cleaner and guarantied to work. It should also work on 1.4.5 and 2.0 (since Palm/HP didn't integrate compcache into those, the script would fail and exit otherwise). Slight alteration to the tail as well - forcing it to only look at one line at a time (tail grabs 8 by default and was messing up testing...)

    Code:
    #!/bin/sh
    limit=53248
    
    tail -f -n1 /var/log/messages \
            | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
            | while read -r line ; do
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo -e "Used: $swap_used_space\\nLimit: $limit"
                    if [ "$swap_used_space" -gt "$limit" ] ; then
                            #echo -e "PAPA BEAR\\nUsed: $swap_used_space \\nLimit: $limit"
                            sync
                            swapoff -a
                            start -q swaphack
                            if [ -e /etc/event.d/compcache ] ; then
                                    start -q compcache
                            fi
                    fi
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo -e "BED TIME\\nUsed: $swap_used_space\\nLimit: $limit"
            done
    Also, a minor (but important!) alteration to /etc/event.d/cleanswap:

    Code:
    # -*- mode: shell-script; -*-
    start on stopped finish
    console output
    exec /etc/init.d/swapcleanup.sh
    The original started "on stopped swaphack". compcache is started AFTER swaphack, so this should start after all that is 100% done. This way, it starts when the system is "finished" loading. This method should also work on 1.4.5/2.0. Minor, but seemed more complete to my brain...


    M.
  6. #66  
    Sorry to pollute the thread but this seems like a place where people may know and I have tried asking elsewhere without any response.

    How can you tell if Compcache is actively doing anything and how big it is without using Govnah? I ask because unlike Android the compcache swap space seems to map into the same bucket as the ram swap. In Android you see two distinct swap items with different priority and it's easy to determine which one is what and what is in use where.

    With webOS the size for the swap space remains a constant 128K (1.4.5) without respect to how large the compcache and swap space together would total so I have assumed that there is some type of mapping overlay that occurs so that compcache simply is used rather than swap space when a swap call is made until the ram is exausted.

    If anyone can point me to a thread where this is dicussed or explain it succinctly I would appreciate it.
  7. #67  
    FWIW - My device was sluggish and laggy and doctoring and leaving off most of my patches has helped a lot. I wonder sometimes if those of us who tinker end up with a configuration filled with a number of glitches from bad patch removals etc.

    In any case, I'm still trying to figure out what the OS does if you are at 235/85 and you clear swap. To my mind that should result in a failure - because I'm assuming you have a Pre not a Pre Plus. In theory the memory needed at that moment is 235+85 and you don't have it. In reality there must be some throwaway items in the list that get tossed. The kernels you are using have the TMC fixes in them without that I wonder if you'd be getting the TMC error immediately after shutting down swap.

    If you are using Compcache - then I can see how this might reorder what is placed where (ram vs. flash) and I can see how that might help - perhaps some fragmentation occurs also and turning this off and back on may have a positive benefit in that way? What happens if you forgo swap completely?

    In any case - I'm struggling with the logic of this action - but acknowledging that in testing this seems to work for you.
  8.    #68  
    well, this is all very exciting and although I haven't been able to be as active of a participant as I would have like to these last few days, I am eager to jump in and help (with almost no programing knowledge). So, It seems that since your last post NickVTPre that there is a new code/program (xanadu73 post#65) that I am guessing needs to be tested, but I don't know how to apply it to my Pre-. If anyone can give me directions I would be glad to test this out
    What does this button do?


    crappy phones -->treo 600--> 700p--> 755p--> Pre--->Pre- 2.1 F104-----Franken Pre+ 2.1 f105 ---> Franken pre2 2.2.4
    touchpad 16gig uberkernel woop woop!!!
  9.    #69  
    Quote Originally Posted by Xanadu73 View Post
    Here is my version that works perfectly. The main thing that's different is the way swap gets turned back on. Rather than (kind of) hack it, I'm doing it the webOS way using upstart. Much cleaner and guarantied to work. It should also work on 1.4.5 and 2.0 (since Palm/HP didn't integrate compcache into those, the script would fail and exit otherwise). Slight alteration to the tail as well - forcing it to only look at one line at a time (tail grabs 8 by default and was messing up testing...)

    Code:
    #!/bin/sh
    limit=53248
    
    tail -f -n1 /var/log/messages \
            | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
            | while read -r line ; do
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo -e "Used: $swap_used_space\\nLimit: $limit"
                    if [ "$swap_used_space" -gt "$limit" ] ; then
                            #echo -e "PAPA BEAR\\nUsed: $swap_used_space \\nLimit: $limit"
                            sync
                            swapoff -a
                            start -q swaphack
                            if [ -e /etc/event.d/compcache ] ; then
                                    start -q compcache
                            fi
                    fi
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo -e "BED TIME\\nUsed: $swap_used_space\\nLimit: $limit"
            done
    Also, a minor (but important!) alteration to /etc/event.d/cleanswap:

    Code:
    # -*- mode: shell-script; -*-
    start on stopped finish
    console output
    exec /etc/init.d/swapcleanup.sh
    The original started "on stopped swaphack". compcache is started AFTER swaphack, so this should start after all that is 100% done. This way, it starts when the system is "finished" loading. This method should also work on 1.4.5/2.0. Minor, but seemed more complete to my brain...


    M.
    So this is awesome and I am very apprieciative of all the work that others have been doing on this.

    I am a bit unsure of how to implement this though, what I did is take the first bit of code, copy it, opened up INTERNALZ, created a new file in the /media/internal/ folder called swapcleanup.sh, pasted the code into that and saved it. I did the same for the second bit of code and saved it as cleanswap


    I opened sdl terminal, typed in /media/internal/, chmod +x swapcleanup.sh, then typed mv swapcleanup.sh /var/usr/bin/, then mv cleanswap /etc/event.d/ tried this and it didn't work.

    Next went into internalz and moved the file (swapcleanup.sh) from /var/usr/bin/ and placed it in /etc/init.d/ as I saw that the second bit of code was referencing this location. rebooted the phone , loaded up a bunch of apps and things, got the swap up to 90, and through a combination on throwing all the app cards away and allowing the screen to shut off the swap has dropped down to 64 but does not seem to be dropping further.

    So thats what I did, unfortunately I don't really know anything about coding but thought that maybe some of this would be useful
    What does this button do?


    crappy phones -->treo 600--> 700p--> 755p--> Pre--->Pre- 2.1 F104-----Franken Pre+ 2.1 f105 ---> Franken pre2 2.2.4
    touchpad 16gig uberkernel woop woop!!!
  10. #70  
    Quote Originally Posted by graffix31 View Post
    you can go into govnah and switch compcache off and save and then go back in and turn it on. it will default to 16mb so change it back to 10 if you want and then turn it back on. it might take a min after you turn it off because it is clearing the swap.
    FYI, I have attempted to do this while the phone is laggin (with no apps open). And most of the time it fails to accomplish this. Returns a error. It works when the phone is snappy. But I don't think the function runs properly when the phone is lagged up.
  11. #71  
    I am testing now the Xanadu73 code:
    http://forums.precentral.net/palm-pr...ml#post2950831
    with swapcleanup.sh in /etc/init.d/ and swapcleanswap in /etc/event.d/
    The startup seems not working for me but if I try to execute directly from Terminal the file swapcleanup.sh with swap populate it works and clean it. I will try the another startup code (Xamil & NickVTPre) to test if it is working for me.

    @Unclevanya: I think you are right. I realize that you have a lot more knowledge on the subject. I can only contribute to the community testing code other's and reporting the result. I do not even know if this will improve my experience with my old Pre-but I like to try.
    Spanish translator of Outline Tracker, UberCalendar, sconix's advanced patches, and other MIA webOS apps. HP Pre 3 and HP TouchPad 64 GB (Español_España, es_es)
  12. #72  
    Quote Originally Posted by CptOx View Post
    The startup seems not working for me but if I try to execute directly from Terminal the file swapcleanup.sh with swap populate it works and clean it.

    Indeed. This is the exact same thing I'm seeing. If run on its own, it's fine but will not run "in the background".

    I've put that aside for the time being because I've decided to do this the Linux way and not the Human way ( ).

    I'm playing with various Linux kernel parameters for controlling how often, how much, etc., the kernel should check for, what's considered "old" and how often to do it. I am having good success.

    I'll type it into a separate post (because it'll be kinda long and a separate post is referenceable by bookmarks and by others).


    M.
  13. #73  
    One thing i noticed when i used the upstart version of this, is that a "ps -A" would list two copies of swapcleanup.sh running. Not sure if this is to be expected, or was an artifact of using the swaphack stopped as the loading point.

    Can anyone else verify that the upstart version is indeed running with the above command?
  14. #74  
    Hey!

    This is long, but needs to be read all the way through (probably a couple times) to get it all especially for those new to Linux.

    The script that dumps swap after a given mount of size I've never got to run in the background. I've moved onto a more "Linux" way of doing it.

    The main problem that I've found is LunSysMgr is set to forcibly "over commit" memory. This means it's allowed to request and allocate more memory than it really needs (and that you have in your device...). There are a couple other factors I'll get to in a sec.

    First, you need to disable LunSysMgr from enabling over_commit:

    • nano /etc/event.d/LunaSysMgr
    • Comment out the line: "echo "1" > /proc/sys/vm/overcommit_memory". (put a # before the word "echo")


    This way when you reboot your phone, Linux will fall back to its default of "0" meaning it'll allow over commits *IF* it feels there's enough memory available to do so, not FORCING them to be allowed whether it's a good idea or not (Palm's default...)

    Secondly, tweak a few parameters at boot time. The absolute easiest way to do this is create a file /etc/sysctl.conf. It won't exist, you have to create it. At boot time, the Linux Kernel looks to this file for quick config changes. The file should look like:

    Code:
    vm.swappiness = 20
    vm.vfs_cache_pressure = 180
    vm.dirty_expire_centisecs = 18000
    vm.dirty_writeback_centisecs = 6000
    #######
    # EDIT:

    The above values were changed. I typed in MILI seconds, not CENTI seconds. They are now 3 minutes and 1 minute, not 30mins and 10mins...
    #######

    I'll explain each (well, this is from the kernel documentation).


    vm.swappiness: This control is used to define how aggressive the kernel will swap memory pages. Higher values will increase aggressiveness, lower values
    decrease the amount of swap.

    vm.vfs_cache_pressure: Controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects.

    vm.dirty_expire_centisecs: This tunable is used to define when dirty data is old enough to be eligible for writeout by the pdflush daemons. It is expressed in 100'ths of a second. Data which has been dirty in-memory for longer than this interval will be written out next time a pdflush daemon wakes up.

    vm.dirty_writeback_centisecs: The pdflush writeback daemons will periodically wake up and write `old' data out to disk. This tunable expresses the interval between those wakeups, in 100'ths of a second. Setting this to zero disables periodic writeback altogether.



    Why choose these? Here's my thinking:

    The default (and Linux's) is for swappiness to be 60 (0 - 100). This means Linux leans towards wanting to USE swap more than not. With 20, it's forcing itself to use RAM more than swap. Cool. Not perfect, but cool. VFS Cache Pressure (0 - 200) is the amount "pressure" it puts on it self to free up memory dedicated to storing looked up inodes and stuff (file/directory look ups). With the higher number, it'll free that stuff up more often. Not much savings there, but the more the merrier!


    Now the fun part.


    dirty_expire_centisecs is the period of time that something is in RAM until it's considered "old" and in turn "swapable". I have it set for 180 seconds (3 minutes). Why? The default is 1 minute (IIRC). The JavaScript Garbage collector takes a while to run after an app's closed. Sometimes longer than the 1 minute meaning the "garbage" left behind is *ELIGIBLE* to be swapped. Why swap known garbage?!? I've been finding 3 minutes to be plenty, but am still playing.

    The dirty_writeback_centisecs is the frequency in which the kernel "scans" memory looking for things that are "old" to put into swap (if it decides swapping is a good idea when it can't just free stuff up). The default is 4 times a minute, I bump it up to once every minute.



    Bottom line:

    I decided to change these with the thought that we don't want to swap to disk too much, and we certainly DON'T want garbage to be swapped, right? So... give the Garbage Collector more time to run BEFORE even looking at what data should be swapped to disk WHICH has a considerably smaller chance of happening to begin with now because it's told not to swap at all as best it can!



    I've been running my phone most of the day (needed to reboot a couple times earlier for testing) but:

    Code:
    root@My Pre:/# uptime
     16:50:09 up  5:12,  1 user,  load average: 0.11, 0.10, 0.95
    
    root@My Pre:/# free -tm
                 total       used       free     shared    buffers     cached
    Mem:           239        212         26          0          0         56
    -/+ buffers/cache:        155         83
    Swap:          103          2        101
    Total:         343        214        128
    
    root@My Pre:/# vmstat
    procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
     1  0   2072  27584    796  57404    0    0    39    34  462  614  9  3 84  4


    I've even been using Ampache Mobile (which caches all songs to RAM!) and this is after just over 5 hours. 2M swap used. I had it like this from yesterday morning up until this morning (again, couple reboots today) and it was only using 24M swap

    Not freakin' bad...


    M.

    P.S.
    I have a couple more "tweaks" but they're a bit more on the "dangerous" side because I don't know what Palm was thinking (well, that goes for just about all of this, but...) or uses the couple settings for I've played with, so I don't know the downsides. If you're interested...
    Last edited by Xanadu73; 05/27/2011 at 03:05 PM. Reason: Added P.S. and fixed typos.
  15. #75  
    Quote Originally Posted by Xanadu73 View Post
    Hey!

    This is long, but needs to be read all the way through (probably a couple times) to get it all especially for those new to Linux.
    ...
    Nice work! Now we just need some more testers to tell you how well this works.
  16. #76  
    Quote Originally Posted by NickVTPre View Post
    Nice work! Now we just need some more testers to tell you how well this works.
    I hope a few people play with this. It's working pretty well for me. Also, I should've added that you'll probably see a bit less battery drain as well because the kernel isn't waking up the disk as often to do swap work. It's not going to be much, but, it may be noticeable.


    M.
  17. Deeder's Avatar
    Posts
    57 Posts
    Global Posts
    58 Global Posts
    #77  
    I have tried it and I seem to be not locking up anymore.
    Since web OS 2.1 my device would lock up after about 3 cards, and always after dr podder started.

    I coped the scrip’s listed above thru the USB, then used internals pro to move them to the correct folder then rebooted. I have over 10 cards open and it’s just now starting to slow down.

    Thanks guys this is really great stuff.
    P.S.
    I did not do step 5 in post 62 (5) type "chmod +x swapcleanup.sh" without quotes.)
    Is that a big deal?
  18. #78  
    Quote Originally Posted by Deeder View Post
    I have tried it and I seem to be not locking up anymore.
    Since web OS 2.1 my device would lock up after about 3 cards, and always after dr podder started.

    I coped the scrip’s listed above thru the USB, then used internals pro to move them to the correct folder then rebooted. I have over 10 cards open and it’s just now starting to slow down.

    Thanks guys this is really great stuff.
    P.S.
    I did not do step 5 in post 62 (5) type "chmod +x swapcleanup.sh" without quotes.)
    Is that a big deal?
    the chmod +x command makes the swapcleanup.sh file executeable by all user groups. No big deal if it isn't going to be run on upstart i believe.

    If i have time later i'll try to write Xanadu's instructions into a layman step-by-step instruction for folks to do.
  19. #79  
    Quote Originally Posted by Deeder View Post
    I did not do step 5 in post 62 (5) type "chmod +x swapcleanup.sh" without quotes.)
    Is that a big deal?

    Yes. That means it won't run at all and anything you're "seeing" is nothing more than a placebo.


    M.
  20. Deeder's Avatar
    Posts
    57 Posts
    Global Posts
    58 Global Posts
    #80  
    How do you know if its running?
Page 4 of 55 FirstFirst 1234567891454 ... LastLast

Posting Permissions