Per-user swap devices.
I have a laptop. It does not have enough RAM.
Due to the fact that the local hard disk is quite slow seeking - I've experimented with swap over wifi to a servers ramdisk - which lets me run more stuff till it slows down. This works very well until there is a wifi problem - at which time everything dies.
While there are partial 'solutions' in some cases - lock stuff in RAM, ... I was wondering about a more general solution.
It would be really nice to be able to simply: chown crashalot.users /dev/swap0 ;swapon /dev/swap0 Then anything run by crashalot would swap to /dev/swap0 - and not locally.
If it crashes, then firefox/whatever else bloated that they were running simply dies.
I assume this is not currently possible.
How much work would it be to get it to be so?
Quoted 8 lines · Ian Stirling
It would be really nice to be able to simply: chown crashalot.users
/dev/swap0;swapon/dev/swap0
Then anything run by crashalot would swap to/dev/swap0- and not locally. If it crashes, then firefox/whatever else bloated that they were running simply dies.I assume this is not currently possible.
How much work would it be to get it to be so?
This doesn't look like it will do as much good as you think. The problem is what to do when something run by some *other* UID needs a page - you need to fix the code to preferentially steal a page from a 'crashalot' process.
And at that point, what you probably want instead is a global per-UID RSS limit. This looks like a job for a CKRM resource class controller rather than a hack to the swap code.
Quoted 5 lines · [email protected] wrote:
Quoted 2 lines · Ian Stirling
It would be really nice to be able to simply: chown crashalot.users
/dev/swap0;swapon/dev/swap0Then anything run by crashalot would swap to/dev/swap0- and not locally.
Quoted 7 lines
This doesn't look like it will do as much good as you think. The problem is what to do when something run by some *other* UID needs a page - you need to fix the code to preferentially steal a page from a 'crashalot' process.
And at that point, what you probably want instead is a global per-UID RSS limit. This looks like a job for a CKRM resource class controller rather than a hack to the swap code.
Not quite.
I've got one set of users that I care about their processes never dying root, ..., and another set that I don't.
I want them to contend for real RAM as normal - it's quite acceptible to me for users in the second group to push root/...s web-proxy, screen session, processes far into slow local swap. Most of these processes will be not very interactive - but I don't want them to die.
If the fast (but unreliable) swap device dies - I'm quite happy for my firefox and mplayer processes to die - but not my window manager or whatever. RSS limits don't address this.
The only way I can think of to address this is to somehow segregate swap devices.