View Single Post
Posts: 18 | Thanked: 72 times | Joined on Sep 2008
#27
Originally Posted by epitaph View Post
I wonder what happens when I make my device entirely and fully swapless? Looking at Conky there is always about 25% free memory left! Isn't Linux supposed to eat all free memory for diskcache and so on? Isn't it the same idea?
I'm fairly certain that Conky only displays memory allocated to processes for the "memory used" graph. The rest of the memory you can assume has been (or will soon be) used by the kernel for disk cache/buffers.

Originally Posted by epitaph View Post
Btw I removed python from being swapped too and my device seems to be very responsive now!
I think that's probably placebo-- most if not all python processes are running as user, not root, and mlocker.so will only work if the process is running with root privileges. If you really want to see how your device runs without swap, then type the following at the console:

Code:
sudo gainroot
swapoff -a
My guess is, if that even succeeds (it didn't on my N900, there just wasn't enough RAM), it might briefly run nice and fast if you don't have any applications open and you don't have any widgets on your home screen, but once you open something (anything, really) it will quickly slow down and then things will start crashing. Maemo 5 really does not want to run with only 256 MB of memory, and trying to squish it in there means that there won't be room for any sort of disk caching. Even desktop Linux machines with 8 GB of RAM will benefit from having swap enabled, just because there is memory that really isn't accessed very often and if it isn't resident in RAM then that space can be used for more caches.

The question of which apps to lock into memory is tricky, because the more RAM you lock up, the less responsive anything else in the system will be. I decided the X server was important enough to lock just because any application that displays anything on the screen, which is most of them, will have to talk to the X server, so it's a common bottleneck. I'm not nearly as sure about the rest, though.

I'm actually considering writing a kernel patch to fine-tune the swapping behavior for different processes; it might be more effective (and efficient) than continuing with the LD_PRELOAD tricks I've been using.
 

The Following User Says Thank You to Cirne For This Useful Post: