Date: Thu, 27 May 2021 04:08:00 +0000 From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 168298] VirtualBox using AIO on a zvol crashes Message-ID: <bug-168298-27103-qEzmUnSHAP@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-168298-27103@https.bugs.freebsd.org/bugzilla/> References: <bug-168298-27103@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D168298 Tom Rushworth <tbr@acm.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tbr@acm.org --- Comment #46 from Tom Rushworth <tbr@acm.org> --- I may have found a clue towards the root cause of bug 168298 (and the dupli= cate 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 numbe= r 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 t= he local resources when the number of such resources meets the AIO sysctl valu= e.=20 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 looke= d at it was 2 weeks ago) should use it as a starting point to make the same deci= sion 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 bett= er alternative. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-168298-27103-qEzmUnSHAP>
