Quote:
Originally Posted by DKSL
Okey lets say I want to switch a process from memory. How can I do it manually by myself(not the kernel)?
|
You can't. As far as I know, there is no kernel module providing that facility.
In a large majority of cases, the user decision on what to swap, would most likely be wrong anyway. Only the kernel has the requisite information on what memory has been accessed recently, to make efficient swapping decisions.
That said, you can always increase
swappiness so that the kernel is more aggressive in swapping out unneeded pages.
If you wanted to create such a facility, you would have to write a kernel module. Note that for the above reasons, you would need very good reasons why this would be useful, in order to get your module accepted upstream. That kernel module would then provide some kind of an interface, perhaps a PID list written to a /sys file. The module would scan the processes for all pages owned by them, and attempt to swap them all out. (You might wish to skip shared mappings, so other processes using e.g. the same libraries won't be affected.)
Because I for one fail to see the usefulness of such a kernel module, I haven't checked the kernel sources to see which interfaces would be useful for this.