Page MenuHomeFreeBSD

Set moea64_bpvo_pool_size based on physical memory

Authored by on Tue, Mar 17, 5:53 PM.



Currently moea64_bpvo_pool_size has a hard coded value of 327680 which is insufficient for initial memory mapping at boot time on systems with, for example, 64G and no huge pages enabled. This patch sets moea64_bpvo_pool_size value based on physical memory plus an expansion factor.
The value estimation for moea64_bpvo_pool_size uses the physical memory and page size as input:

pages = physmem / PAGE_SIZE;
size = pages * sizeof(vm_page);
moea64_bpvo_pool_size = size / PAGE_SIZE * BPVO_POOL_EXPANSION_FACTOR;

Test Plan

For tests, use tool "stress" to allocate memory and see if no panic "bpvo pool exhausted" is raised.
Patch is necessary when stress testing.

Diff Detail

Lint OK
No Unit Test Coverage
Build Status
Buildable 30032
Build 27843: arc lint + arc unit

Event Timeline edited the summary of this revision. (Show Details)Wed, Mar 18, 4:58 PM edited the test plan for this revision. (Show Details)

Adjust moea64_bpvo_pool_size value only if hw_direct_map is false, otherwise set it to previous hard-coded value.

jhibbits added inline comments.Wed, Mar 18, 8:48 PM

This needs to be a '== 0', since moea64_bpvo_pool_size is an integer used as an integer, not a boolean.


I'd make the 327680 a #define, commented that it's a sane historical default.

luporl added inline comments.Thu, Mar 19, 11:35 AM

It seems you are indenting with 2 spaces, but tabs should be used instead, except when you wrap long statements (as in the line below), then you should add 4 spaces.
Check style(9).

Style (indentation, comparison) fixes. marked 3 inline comments as done.Thu, Mar 19, 12:43 PM
alfredo added inline comments.Fri, Mar 20, 2:41 PM

I think would be good print a message containing pool size and memory used by this pool when kernel boots is in verbose mode (boot -v).
Something like:

if (bootverbose)

Good idea, thanks.


It looks like it's not possible to use 'bootverbose' at this stage of the boot. This variable is set later by init_main.c:129.

jhibbits added inline comments.Fri, Mar 20, 6:36 PM

(boothowto & RB_VERBOSE) does the same thing, and should be available almost immediately.

Print information message about number of bpvo pool entries and memory used by this pool when booting in verbose mode. marked 2 inline comments as done.Fri, Mar 20, 8:51 PM
jhibbits accepted this revision.Wed, Apr 1, 6:43 PM
This revision is now accepted and ready to land.Wed, Apr 1, 6:43 PM