Subject: Re: Bad response...
To: Johnny Billquist <bqt@Update.UU.SE>
From: Arto Huusko <>
List: current-users
Date: 08/31/2004 18:16:02
On Tue, 31 Aug 2004, Johnny Billquist wrote:
> On Tue, 31 Aug 2004, Noriyuki Soda wrote:
> > FWIW, I'm actually using {2,4} for vm.file{min,max} on my machines,
> > and I'm happier than the default.
> > Note that the machines can use most of memory for file cache even
> > with the {2,4} setting, if anon pages and exec pages aren't big.
> On a different note, then. What *exacly* does vm.filemax say???
> The system will use more if more is available. I imagine I understand what
> vm.filemin says...

vm.*max limits the amount of memory a facility can claim, if there is not
enough memory to satisfy all claims to memory. vm.*min says how much
must be made available for a facility, if it requires some memory.

Now, if I understand correctly, there are several cases which are not
immediately obvious. Note that I could be wrong here.

 1. A facility can claim more memory than its max says, even when there
    is contention for pages, if other facilities are over their max.
    Say your execmax is 50, but actually 75 percent of memory is
    allocated for executable pages. Say filemax is 5 percent. In this
    case, the file cache can claim the excessive 25 percent of pages
    allocated for executables if it needs them.
    This is because nothing stops a facility from allocating more
    pages than it needs if there are pages that are either free or
    can be paged out. And the exec pages can be paged out in this case,
    because they are over execmax.

 2. Continuing the previous, if your filemax were 50 percent, filecache
    could claim those 50 percent of pages, and drop the amount of
    memory allocated for executable pages down to 25 percent.
    In this case the file cache does not exceed its limit, but it does
    reclaim from executable pages in order to satisfy itself up to
    its max. However, if your execmin was 49, then this wouldn't happen,
    because the reclaim logic tries to keep the amount of memory allocated
    for each facility between the min and max values of the facility.

So, unless I'm wrong, anything over max value is as good as "free"
for someone needs it, and anything over min value is as good as "free"
for someone who is below its own max and needs it (you always get your
share up to your max, unless there are min values that prevent it).