public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Per-user swap devices.
@ 2006-07-19  9:54 Ian Stirling
  2006-07-19 15:00 ` Valdis.Kletnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Stirling @ 2006-07-19  9:54 UTC (permalink / raw)
  To: linux-kernel

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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Per-user swap devices.
  2006-07-19  9:54 Per-user swap devices Ian Stirling
@ 2006-07-19 15:00 ` Valdis.Kletnieks
  2006-07-19 18:24   ` Ian Stirling
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis.Kletnieks @ 2006-07-19 15:00 UTC (permalink / raw)
  To: Ian Stirling; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

On Wed, 19 Jul 2006 10:54:38 BST, Ian Stirling said:

> 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.

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Per-user swap devices.
  2006-07-19 15:00 ` Valdis.Kletnieks
@ 2006-07-19 18:24   ` Ian Stirling
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Stirling @ 2006-07-19 18:24 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: linux-kernel

Valdis.Kletnieks@vt.edu wrote:
> On Wed, 19 Jul 2006 10:54:38 BST, Ian Stirling said:
> 
>>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.

> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-19 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-19  9:54 Per-user swap devices Ian Stirling
2006-07-19 15:00 ` Valdis.Kletnieks
2006-07-19 18:24   ` Ian Stirling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox