Best way to get max KVA setting?

Terry Lambert tlambert2 at mindspring.com
Wed Jun 25 22:49:07 PDT 2003


Mike Silbersack wrote:
> I found the thread in question, but I didn't see a patch.

ARGH.  There was a simultaneous off-list discussion; here is
the scrubbed part of what I sent; it's a patch, but it's not a
diff; sorry for the confusion.

-- Terry
-----------------------------------------------------------------
The correct place to hack the is /usr/src/sys/kern/subr_param.c.

Specifically, every place it references "physpages", the number
is way, way too big.

At the very top of the routine init_param2(), put something like:


        long ephyspages;                /* effective physical pages */
        long clamp = 3 * 1024 * 256;    /* 3G, in pages */

        ephyspages = physpages;

        /* clamp effective memory to real KVA limits */
        if (ephyspages > clamp)
                ephyspages = clamp;


And then everywhere it references "physpages" below that, change
it to "ephyspages" instead.

In the version of the file I have, it looks like you could
override everything at boot time; I didn't check to see how
much (or if) this had changed in -current, so it may be that
you could tweak everything you needed to then, instead.
-----------------------------------------------------------------


More information about the freebsd-current mailing list