Subject: Re: failing to keep a process from swapping
To: enami tsugutomo <enami@but-b.or.jp>
From: Arto Selonen <arto@selonen.org>
List: tech-kern
Date: 10/30/2004 10:50:22
Hi!

On Sat, 30 Oct 2004, enami tsugutomo wrote:

> > Perhaps is it better to change the calculation of (uvmexp.active +
> > uvmexp.inactive + uvmexp.free) in uvmpd_scan_inactive() to
> > uvmexp.npages?
>
> I don't think it's better since pagedaemon can do something only for
> pages on the queues.

It may only work with the queues, but *why* do those min,max limits exist?
Why does pagedaemon reactivate pages from inactive queue based on those
limits? Those who understand UVM probably know, I can only guess.
And te way I read the limits is that they are a way for the system admin
to tell the system, what sort of a balance of different page types
(anon, exec, file) the VM subsystem should keep resident. The
documentation makes sense to me (as I don't know any better), but the
code does not.

One third of available memory could be wired, kernel seems to take ~10%,
so whatever limits are given, in reality the limits used could be
over 60% smaller than what was thought. And the limits keep changing!
That is a very bad premise for precise control of memory usage.
(And I would prefer precise control with a loaded gun pointed to my
virtual foot, over fuzzy guess work that is safe). :)

However, since I can not possibly understand all possible scenarios
and aspects of UVM behaviour, I certainly don't want to argue
"it should be so". I am merely trying to point out that from
a user's point of view, the current min,max limits are quite
difficult to use, and they would be more useful for the user, if used
differently. In any case, either code or documentation needs changing.


Artsi
-- 
#######======------  http://www.selonen.org/arto/  --------========########
Everstinkuja 5 B 35                               Don't mind doing it.
FIN-02600 Espoo        arto@selonen.org         Don't mind not doing it.
Finland              tel +358 50 560 4826     Don't know anything about it.