# How to enable NUMA in 11.1-RELEASE?



## darecki (Apr 16, 2018)

Hi Everyone,

I started with `man 4 numa`. 
Before I even started I enabled NUMA in BIOS and checked my dmesg which shows stuff such as:


```
SMP: AP CPU #1 Launched!
SMP: AP CPU #41 Launched!
SMP: AP CPU #40 Launched!
SMP: AP CPU #5 Launched!
SMP: AP CPU #48 Launched!
SMP: AP CPU #26 Launched!

cpu38: <ACPI CPU> numa-domain 1 on acpi0
cpu39: <ACPI CPU> numa-domain 1 on acpi0
cpu40: <ACPI CPU> numa-domain 2 on acpi0
cpu41: <ACPI CPU> numa-domain 2 on acpi0

pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff numa-domain 0 on acpi0
pci0: <ACPI PCI bus> numa-domain 0 on pcib0
```

However,

```
[root@testmother ~]# sysctl vm.ndomains
vm.ndomains: 1
```

I inspected GENERIC and found:

```
# Make an SMP-capable kernel by default
options         SMP                     # Symmetric MultiProcessor Kernel
options         DEVICE_NUMA             # I/O Device Affinity
options         EARLY_AP_STARTUP
```

man 4 numa says:


```
options SMP
options MAXMEMDOM=16
```

At  this point I blamed lack of MAXMEMDOM in generic. I've added this option, recompiled kernel, rebooted and still only one domain in userland. How can I enable it?


----------



## darecki (Apr 16, 2018)

And how can I set default NUMA policy? Tried in loader.conf but seems not loading.


----------



## schmitmd (Aug 1, 2018)

Not sure if it's helpful, but when you do a 
	
	



```
make LINT
```
 for a full options dump of a kernel config, you get this line: 
	
	



```
options    MAXMEMDOM=2
```
  As such, I would expect this to be the default in GENERIC, but I'm still learning.  I'm not sure on the policy setting. Sorry!

EDIT:
For the record:  I'm on 11.2-RELEASE.  It seems new code was merged in recently to clear up old NUMA code: https://reviews.freebsd.org/D14037
Also, according to sys/conf/NOTES:
"MAXMEMDOM defines the maximum number of memory domains that can boot in the system.  A default value should already be defined by every architecture."


----------

