Page MenuHomeFreeBSD

Set moea64_bpvo_pool_size based on physical memory
ClosedPublic

Authored by afscoelho_gmail.com on Mar 17 2020, 5:53 PM.
Referenced Files
Unknown Object (File)
Nov 23 2024, 1:45 PM
Unknown Object (File)
Oct 2 2024, 7:08 PM
Unknown Object (File)
Sep 26 2024, 5:28 AM
Unknown Object (File)
Sep 13 2024, 4:29 AM
Unknown Object (File)
Sep 8 2024, 5:55 PM
Unknown Object (File)
Sep 5 2024, 6:45 PM
Unknown Object (File)
Aug 31 2024, 9:11 AM
Unknown Object (File)
Aug 22 2024, 1:32 PM

Details

Summary

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 https://reviews.freebsd.org/rS358670 is necessary when stress testing.

Diff Detail

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

Event Timeline

afscoelho_gmail.com 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.

sys/powerpc/aim/mmu_oea64.c
922

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

927

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

sys/powerpc/aim/mmu_oea64.c
924

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.

sys/powerpc/aim/mmu_oea64.c
928

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)
    printf(".....\n");
sys/powerpc/aim/mmu_oea64.c
928

Good idea, thanks.

sys/powerpc/aim/mmu_oea64.c
928

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.

sys/powerpc/aim/mmu_oea64.c
928

(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.

This revision is now accepted and ready to land.Apr 1 2020, 6:43 PM
This revision was automatically updated to reflect the committed changes.