View Single Post
Posts: 249 | Thanked: 277 times | Joined on May 2010 @ Brighton, UK
#243
Originally Posted by vi_ View Post
Not really such a great idea, what if someone is using uSD but not ramz and wants swappolube settings?
This ocurred to me as well. Always best to aim to be a good neighbour

I propose then that swapset will have a set of override settings it will apply only when compcache is active. The trick will be managing to convince them to apply after swappolube's /etc/event.d/tuning gets executed. Hopefully upstart has dependencies in there somewhere.

I'm thinking a set of defaults as given in this thread, with another set of overrides in /etc/default/swapset, i.e.
Code:
# Size of cache in KB
#COMPCACHE_SIZE	=	"65536"

# Swap priorities
#PRIORITY_COMPCACHE	=	"15"
#PRIORITY_EXTERNAL	=	"10"
#PRIORITY_INTERNAL	=	"0"

# Timeout for device node to be ready in seconds
#COMPCACHE_TIMEOUT	=	"10"  

# VM tuning for compcache
DEFAULT_COMPCACHE_TUNING	=	"true"
#vm_dirty_ratio			=	"3"
#vm_dirty_background_ratio	=	"3"
#vm_dirty_writeback_centisecs	=	"100"
#vm_dirty_expire_centisecs	=	"100"
#vm_min_free_kbytes	=	"32"
#vm_swappiness		=	"95"
#vm_vfs_cache_pressure	=	"200"
#vm_page-cluster	=	"0"
#int_nr_requests	=	"4000"
#ext_nr_requests	=	"4000"
Originally Posted by vi_ View Post
Finally I would not be so hasty to add this to your start up unless you are comfortable with using a rescue console to undo what may go wrong.
The next item I wanted to add to swapset before my hiatus was a semaphore to signal the device booted OK to prevent reboot loops. Something simple, like an empty file when it starts that it then removes at the end. If it finds the file on boot, don't apply the settings and report to the user. Should hopefully make things safer.

Anyway, I'll get on this once I get a few minutes and:
  • Add boot semaphore
  • Fix timeout bug reported by peterleinchen
  • Fix bug reported by alfred, which IIRC, was due to having a SD card active without a swap partition on it (wish this forum saved sent PMs! - Incidentally, please email me bugs for exactly this reason)
  • Pull in override params from config file /etc/default/swapset
  • Override swappolube settings when compcache is active

That everything?
 

The Following 3 Users Say Thank You to mr_jrt For This Useful Post: