[Bug 168298] VirtualBox using AIO on a zvol crashes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu May 27 04:08:03 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=168298

Tom Rushworth <tbr at acm.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tbr at acm.org

--- Comment #46 from Tom Rushworth <tbr at acm.org> ---
I may have found a clue towards the root cause of bug 168298 (and the duplicate
212128) where virtualbox-ose locks up or crashes doing heavy AIO.

I found the location in the source code where virtualbox picks up the sysctl
value:
   vfs.aio.max_aio_per_proc
but could not find any place in the code that actually used it to make any sort
of decision.  The virtualbox AIO code would attempt to grow the local number of
allowed AIO requests whenever it got EAGAIN, without any limit.  When the
attempt to grow went past the sysctl value so that the attempt failed, bad
things happened :).

I have attached a tiny but very ugly patch that stops the attempt to grow the
local resources when the number of such resources meets the AIO sysctl value. 
The patch makes my virtualbox version 6.1.20 running on FreeBSD 13.0 stop
crashng even when the AIO sysctl values are left at the default installed
values.  It also (when adjusted for line number differences) makes my 5.2.34
virtualbox running on FreeBSD 12.1 with AIO stable.  Both versions of
virtualbox had a fairly repeatable crash or lockup with a Linux Mint 20 VM when
I tried to upgrade the kernel and headers.  After applying the patch I was able
to upgrade the VMs with no problems and no changes to the AIO sysctl values.

I do not suggest this patch as any sort of final solution :).  Someone far more
knowledgable about the virtualbox code than I (since the first time I looked at
it was 2 weeks ago) should use it as a starting point to make the same decision
about growing the number of local resources for AIO requests in a virtualbox
consistent way (and style :) ).  The patch would do as a workaround while we
all wait for the virtualbox code gurus to improve it or come up with a better
alternative.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-virtualization mailing list