I installed FreeBSD 12.2 in a VMware virtual machine, and get the following console output on every boot:
> warning: total configured swap (262134 pages) exceeds maximum recommended amount (215992 pages).
> warning: increase kern.maxswzone or reduce amount of swap.
I selected only the defaults going through the installer on the disc1 ISO. It seems like the installer would ideally not create more swap than the kernel supports, or might arrange for loader.conf to be suitably tuned if it were to do so.
robert@freebsd-amd64:~/git % gpart list
Geom name: da0
1. Name: da0p1
Mediasize: 524288 (512K)
2. Name: da0p2
Mediasize: 20400570368 (19G)
3. Name: da0p3
Mediasize: 1073700864 (1.0G)
1. Name: da0
Mediasize: 21474836480 (20G)
I should have included this further information:
real memory = 268435456 (256 MB)
avail memory = 218734592 (208 MB)
(In reply to Robert Watson from comment #1)
You can just ignore this warning.
There's probably also an argument for always allocating enough state to support 1GB of swap, given that possibly that is what the installer thinks is the minimum?
(In reply to VVD from comment #2)
I am happily ignoring the warning. But I guess the point I'm trying to make is: Our installer should not, by default, create configurations that require warnings. This might be fixed by changing the behaviour of the installer (set up less swap if we're going to create a configuration that will trigger a warning), or by changing the kernel (e.g., to to tune for at least 1GB of swap no matter the physical memory size, since we've decided in the installer that 1GB is a good minimum). Or maybe the warning is boring and we should suppress it.
Absolutely we should not have warnings that should be ignored or are unactionable after completing a default install. That said, for this specific case I think a warning for the relatively small amount of memory provisioned for the VM might be appropriate.
Or we can grab the maximum from sysctl:
% sysctl -d vm.swap_maxpages
vm.swap_maxpages: Maximum amount of swap pages supported
% sysctl vm.swap_maxpages
If bsdinstall warned that the VM might be under provisioned, and we expect that the VM might get resized as a result, we would likely want to the larger swap size. This suggests that the problem is too many warnings from the kernel, and not enough from the installer?
What might a suitable patch look like or do?