l4-hurd
[Top][All Lists]
Advanced

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

Re: self-paging


From: Bas Wijnen
Subject: Re: self-paging
Date: Tue, 29 Nov 2005 21:35:24 +0100
User-agent: Mutt/1.5.11

On Tue, Nov 29, 2005 at 12:44:46PM -0500, Mike Small wrote:
> > 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
> 
> What if a process waits for a slow period (maliciously or because a user
> knows a certain time of night is a good time to start big jobs) and starts
> up a process that takes a huge amount of memory right away but never asks
> for any more or releases any voluntarily?

As long as it's the only process, there is no memory pressure (well, not
between two tasks at least) and it will simply get as much as possible.  When
new processes start up, more than one will be asking for memory, which isn't
available.  At first, nothing happens.  That is, the processes will be really
slow unless there was some reserved memory for the purpose.  But after some
time, the big processes "physical memory quota" will decay and it will not
regenerate as fast, because there are other processes asking for it as well.
So some of its pages will be swapped out (or discarded if they were marked
"cache") in favour of other processes.

> Or for
> that matter, is there anything that does appropriate paging out if the
> algorithm only really visits a certain part of the matrix most of the
> time - ie an appropriate working set for the process should be much
> smaller than the huge set it initially asked for.

If there is no memory pressure, the rest will stay right there.  But if there
is, it will surely have the pages it needs at the start of the list, so
they're the last to be swapped out.  Once the others have been swapped out
(because there was memory pressure) they will not return to physical memory
until the process asks for them again.  Note that the process is not notified
when they are swapped out either, but it could continuously request its
physical memory quota and find out semi-instantly anyway.

> My question, I guess, is how do you handle fairness among processes?

That is not something that my idea solves.  The idea just allows self-paging,
and it tries to narrow the bandwidth of a covert channel.  How exactly the
quota degrades with time and who gets more when several processes are asking
is a different question.  This is the fairness question.  It needs to be
answered anyway, but I wasn't trying to do so. ;-)

> If I've understood you correctly, I think this way degrades to a game
> of King of the Castle.

I don't think I understand what you mean with that, so I cannot confirm that
you understood me correctly.

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]