Page MenuHomeFreeBSD

Fix boot on systems where NUMA domain 0 is unpopulated.
ClosedPublic

Authored by markj on May 25 2020, 3:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 29, 11:34 AM
Unknown Object (File)
Tue, Jan 21, 7:38 AM
Unknown Object (File)
Sun, Jan 19, 4:51 PM
Unknown Object (File)
Sun, Jan 12, 4:58 PM
Unknown Object (File)
Nov 11 2024, 5:34 AM
Unknown Object (File)
Sep 30 2024, 11:11 PM
Unknown Object (File)
Sep 18 2024, 9:36 PM
Unknown Object (File)
Sep 18 2024, 9:52 AM
Subscribers

Details

Summary

Add vm_phys_early_add_seg(), complementing vm_phys_early_alloc(), to
ensure that segments registered during hammer_time() are placed in the
right domain. Otherwise, since SRAT is not parsed at that point, we
just add them to domain 0, which may be incorrect and results in a
domain with only several MB worth of memory.

Fix uma_startup1() to try allocating memory for zones from any domain.
If domain 0 is unpopulated, the allocation will simply fail, resulting
in a page fault slightly later during boot.

Test Plan

I popped the DIMMs out of socket 0 on a 2-socket system and tried
booting HEAD.

The submitter of PR 246638 reports that this fixes booting HEAD on
a threadripper.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.May 25 2020, 3:24 PM
markj created this revision.
markj added reviewers: alc, jeff, kib.
cem added a subscriber: cem.
cem added inline comments.
sys/vm/uma_core.c
2831–2833 ↗(On Diff #72239)

I guess if we had locality information at this point it would be nice to try to the closer domains first. Clearly this is better than status quo, though.

This revision is now accepted and ready to land.May 25 2020, 5:37 PM
sys/vm/uma_core.c
2831–2833 ↗(On Diff #72239)

The allocation here is for global structures, so there's no obvious way to choose the "right" domain, and the structures are rarely used anyway (mainly by uma_zcreate()). We only pass a domain here because startup_alloc() implements the keg allocator interface.

sys/vm/uma_core.c
2831–2833 ↗(On Diff #72239)

Ah, I failed to observe they were global.

Modify _vm_phys_domain() to return -1 if the system has a memory
affinity table and the paddr is not referenced by any entry. This
happens in pmap_page_array_startup() since the page array is dense.

Handle wildcard domains in vm_phys_early_alloc(), just return memory
from any domain. Modify UMA to assert that items always come from a
valid domain.

This revision now requires review to proceed.May 27 2020, 3:44 PM
markj added a reviewer: rlibby.
This revision is now accepted and ready to land.May 28 2020, 6:44 PM