tech-kern archive

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

Re: Prefer pageing to swapping

matthew green wrote:

>    I notice that is swapping even when not paging. This patch
>    changes the pagedaemon to prefer paging to swapping, and ups the minimum
>    free limit.
>    Comments?
> the 20 -> 200 divisor change should become based on memory size or
> something else.  the 20 value was valid for a particular memory
> size and while the 200 value might be valid for the machines you're
> using that isn't true for everything.  i think this needs to be some
> thing that is based on ram size, but with some other calculation
> that works out higher for low ram systems.
> it definately it too much for modern high end systems.

I think the proposed patch already does that?

+       /*
+        * try to keep 0.5% of available RAM free, but limit to between
+        * 128k and 1024k per-CPU.  XXX: what are these values good for?
+        */
+       uvmexp.freemin = uvmexp.npages / 200;
+       uvmexp.freemin = MAX(uvmexp.freemin, (128*1024) >> PAGE_SHIFT);
+       uvmexp.freemin = MIN(uvmexp.freemin, (1024*1024) >> PAGE_SHIFT);
+       uvmexp.freemin *= ncpu;

So that's gonna peg at 1MB per CPU which (for lack of other evidence)
seems somewhat reasonable.  I'd be curious to know the origin of the
original "between 16k and 256k" given the (pre-existing) "XXX: what are
these values good for?" comment.


Home | Main Index | Thread Index | Old Index