Subject: Re: failing to keep a process from swapping
To: SODA Noriyuki <soda@sra.co.jp>
From: Arto Selonen <arto@selonen.org>
List: tech-kern
Date: 10/30/2004 10:32:54
Hi!

Thanks for the clarification. I've already started writing a web page
about VM tuning, from the sysadmin point of view. I'll try to update
all this to the page, when relevant. Once the draft is complete enough
in coverage (but probably still wrong in many ways), I'll announce it
here so people can comment/correct all my mistakes. Hopefully, it
could then be used as a base (or source of cut&paste) for updating
the official NetBSD tuning document (if found useful enough for that).

On Fri, 29 Oct 2004, SODA Noriyuki wrote:

> >>>>> On Fri, 22 Oct 2004 18:37:08 +0300 (EEST),
> 	Arto Selonen <arto@selonen.org> said:

> > My understanding from the 'Bad response' thread was that the maximums
> > would be exceeded only when there was memory to spare.
>
> That's misunderstanding.
> What the vm.{anon,exec,file}{min,max} parameters do is to prevent
> the page scanner work until the ratios hit the parameters.
>
> For example, a memory consumer can exceed its maximum not only when
> there is memory to spare, but also when
>   - there is other memory consumer which already exceeds its maximum
> and
>   - the page scanner think that the consumer is using memory recently.

You mean that it is possible that even though a certain page type
is over its maximum, the pages are so far back in inactive queue,
that they are not reached during the page scan before sufficient number
of pages are freed, thus those pages still remain over limits (and still
in inactive queue, but now closer to the begin of it), and don't
get freed? If so, then I think I've got it now. :)

> You can reduce the bufcache more by using vm.bufmem_hiwater and
> vm.bufmem_lower.

Aah. I'll try that later (when doing the next upgrade of current).

> BTW, I think the 5% hard limit in the kernel is too high.

At least on GB scale systems it would appear a bit high.


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.