l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

self-paging


From: Bas Wijnen
Subject: self-paging
Date: Tue, 29 Nov 2005 17:15:26 +0100
User-agent: Mutt/1.5.11

Hello,

It's getting quiet on this list, so I'll start a new thread. :-)

I have an idea about self-paging, and would like to hear your opinions about
it.  Here it is:

Every process has a quota which allows it access to some memory.  Usually, the
sum of all quota is larger than the amount of physical memory, and perhaps
also larger than the amount of disk space.  This is not supposed to be new.

Every process must keep a list of which pages it holds.  This list is ordered
(and can be reordered by the process) by priority.  That is, when the system
decides to swap out a page of the process, it will take the one at the end of
the list.  So at any time, the last P pages from the list are swapped out, and
the first N - P are not (where N is the size of the list).  0 <= P <= N.

Also, each entry in the list has a "cache" flag, which when set means the page
can be discarded instead of swapped out.

And now the interesting part: how to determine when to swap out pages?

Effectively, this system gives every process a quota on physical memory, N -
P.  The quota can change at run-time, but not fast.  A process may request
what its current quota is.  My idea is to let the quota change according to
use, but usually not abruptly.  If a process suddenly needs a lot of memory,
and it is available, it gets it.  If then there is memory pressure, it keeps
it for some time.  If it suddenly drops most of it, it still keeps the quota
for some time.  This may cost a bit of performance in very unusual situations
(where multiple processes are mallocing and freeing huge chunks of memory),
but closes (or at least severely limits) a high-bandwidth covert channel.

So to make things clear:  In case of memory pressure (that is, the sum of
quota is equal to the amount of physical memory), when a process requests a
new page (either really new, or from swap), an other page of itself will be
paged out.  This is done by rearranging the list of owned pages.  When a
process frees a page, and thus uses less than its quota, the quota will slowly
decay.  This should also happen in general, using some priority scheme
(perhaps the same which is used for scheduling, and perhaps a different one).

I hope I've made clear what I mean.  My questions to you:
- Is this a good idea?
- If it isn't, what's wrong with it?
- If it is, what does this mean for our choice of kernel? Will/can it be
  implemented in/on top of {L4ng,L4sec,Coyotos}?

Thanks,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://129.125.47.90/e-mail.html

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]