Page MenuHomeFreeBSD

Add more fine-grained kernel options for NUMA support.
ClosedPublic

Authored by jhb on Mar 30 2016, 5:15 PM.
Tags
None
Referenced Files
F103573873: D5782.diff
Tue, Nov 26, 4:13 PM
Unknown Object (File)
Oct 14 2024, 7:36 AM
Unknown Object (File)
Oct 11 2024, 7:14 PM
Unknown Object (File)
Oct 6 2024, 11:19 PM
Unknown Object (File)
Oct 4 2024, 1:28 PM
Unknown Object (File)
Sep 29 2024, 1:19 AM
Unknown Object (File)
Sep 24 2024, 5:54 AM
Unknown Object (File)
Sep 15 2024, 4:28 PM
Subscribers

Details

Summary

Add more fine-grained kernel options for NUMA support.

VM_NUMA_ALLOC is used to enable use of domain-aware memory allocation in
the virtual memory system. DEVICE_NUMA is used to enable affinity
reporting for devices such as bus_get_domain().

Note that 'cpuset -gd' always works.

If we left vm_ndomains at 1 in the !VM_NUMA_ALLOC case this would probably
reduce the diff. However, I would probably need to do something else to
handle bootstrapping 'cpuset -gd'. Perhaps I can just make the non-NUMA
fallback check to see if the set is empty and ignore it if it is non-empty
(though that assumes that domain 0 will always have at least one valid
CPU). I could perhaps check all of the sets and bail if any of them are
non-empty. The only other issue is if userland code checks vm.ndomains
and if so what is it expecting it to be used for. If it expects it to mean
that the kernel supports NUMA allocation then we should probably be leaving
it at 1.

Test Plan
  • booted kernels with MAXMEMDOM increased and various combinations of the NUMA options

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3071
Build 3103: arc lint + arc unit

Event Timeline

jhb retitled this revision from to Add more fine-grained kernel options for NUMA support..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added reviewers: adrian, kib.
sys/conf/options
601

Do we need this in opt_global.h ? The stuff is localized in acpica and _some_ vm/ files.

sys/vm/vm_page.c
469

Why would it bad idea to initialize all configured domains ? Then several pieces below would not need #ifdef VM_NUMA_ALLOC, mostly in ddb.

The only not very desirable consequence I see is that ddb commands would output empty domains, but I could argue that this is what should be done since the structures are allocated.

sys/vm/vm_phys.c
529

IMO this asks for two separate function bodies.

jhb marked an inline comment as done.Apr 1 2016, 4:58 PM
jhb added inline comments.
sys/vm/vm_page.c
469

Well, MAXMEMDOM structures are allocated. Even when VM_NUMA_ALLOC is configured, vm_ndomains can be < MAXMEMDOM. It is probably simpler if I just fix vm_ndomains to only be non-zero if VM_NUMA_ALLOC is true. I need to fix cpuset to stop using vm_ndomains, but that isn't a huge issue.

  • Don't use vm_ndomains in the cpuset code.
  • Only set vm_ndomains if VM_NUMA_ALLOC.
  • Use a separate function body.
  • Simplify now that vm_ndomains == 1 in the !VM_NUMA_ALLOC case.
  • Move the NUMA options out of opt_global.h.
kib edited edge metadata.
kib added inline comments.
sys/vm/vm_phys.c
51

I think it would be simpler and cleaner to include sys/proc.h unconditionally.

This revision is now accepted and ready to land.Apr 9 2016, 10:40 AM
This revision was automatically updated to reflect the committed changes.
jhb marked an inline comment as done.

Dummy comment to workaround phab's bug that you can't mark something as done as a standalone change.