Tweaking swap algorithm under constrained memory usage

From: Pawan Singh
Date: Wed Oct 27 2010 - 14:41:27 EST


I have a requirement where a user space process needs to allocate 75%
of the memory on the machine and keep it locked i.e. not swappable.
Other processes need to share the rest of the memory. Swap is enabled.
I was wondering what tweaks would be required so that the swapping
alogrithms' thresholds are based on 25% of the memory rather than on
100% of the memory. If I leave this at default, kswapd may decide to
swap a lot more pages than really required because 75% of pages are
locked. I am working on 2.6.22 kernel. I can use "swappiness" factor
and reduce it - but I wanted to know if I can alter something
fundamental in the kernel code to make life for rest of the processes
better.

Thanks for any suggestions.

-Pawan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/