Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2021 18:21:03 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        John Doherty <bsdlists@jld3.net>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: increasing bhyve VM_MAXCPU
Message-ID:  <202105190121.14J1L3BV001126@gndrsh.dnsmgr.net>
In-Reply-To: <7C6FC30B-BADC-4D32-AA2B-5F00B5E874F6@jld3.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> I'm experimenting with bhyve VMs with more than 16 vCPUs on FreeBSD 
> 12.2-RELEASE.
> 
> As I understand it, this limit is defined as VM_MAXCPU in 
> /usr/src/sys/amd64/include/vmm.h. I also understand that as of about two 
> years ago, it should be possible to increase it beyond 21[1].
> 
> I began working on a machine with only eight CPU cores/threads, so 
> rather than trying to increase VM_MAXCPU, I tried to decrease it, which 
> seemed to work fine. My procedure was:
> 
>    edit /usr/src/sys/amd64/include/vmm.h

cp /usr/src/sys/amd64/include/vmm.h /usr/include/machine/vmm.h

>    cd /usr/src/lib/libvmmapi ; make clean ; make ; make install
>    cd /usr/src/usr.sbin/bhyve ; make clean ; make ; make install
>    cd /usr/src/usr.sbin/bhyvectl ; make clean ; make ; make install
>    cd /usr/src/usr.sbin/bhyveload ; make clean ; make ; make install

All of this code you built used the old value as you did not
propogate your change to vmm.h to the installed system, since
your running individual make commands the includes in /usr/include
are used.

>    cd /usr/src ; make buildkernel KERNCONF=JLD ; make installkernel 
> KERNCONF=JLD
>    reboot

Your kernel has the new value you put in vmm.h, so now you
have created a userland/kernel missmatch on some data structures.

> 
> where JLD is a kernel config file that differs from GENERIC only in the 
> "ident" line.
> 
> I tried several values (1, 2, and 4) for VM_MAXCPU and verified that VMs 
> with a number of vCPUs less than or equal to the max booted fine and 
> that VMs with more didn't.
> 
> So then I tried increasing VM_MAXCPU on a machine with two CPUs, 14 
> cores/28 threads each, using the same procedure. I set VM_MAXCPU to 28 
> and configured a VM with 24 vCPUs but that didn't boot. Also tried 
> setting the max to 20 and booting a VM with 18 vCPUs but that didn't 
> work either. In all cases, VMs with 16 or fewer vCPUs continued to boot 
> fine.
> 
> All the tests were done with VMs created before doing any of this stuff. 
> I am using vm-bhyve to manage VMs. The VMs in these tests were running 
> one of FreeBSD 12.2-RELEASE, alpine linux 3.13, and debian-testing.
> 
> So it seems like I'm overlooking something but I don't know what, or 
> maybe this just isn't going to work. Anybody have experience actually 
> doing this?
> 
> Thanks very much for any advice or further information.
> 
> [1] <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212782>;
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"
> 

-- 
Rod Grimes                                                 rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105190121.14J1L3BV001126>