From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ0Nb-0005DT-03 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 09:57:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJ0NY-0005Wf-FZ for qemu-devel@nongnu.org; Tue, 12 Jan 2016 09:57:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ0NY-0005WG-7m for qemu-devel@nongnu.org; Tue, 12 Jan 2016 09:57:00 -0500 Date: Tue, 12 Jan 2016 14:56:55 +0000 From: "Daniel P. Berrange" Message-ID: <20160112145655.GO17626@redhat.com> References: <1452608259.29014.26.camel@redhat.com> <20160112143640.GF4841@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160112143640.GF4841@noname.redhat.com> Subject: Re: [Qemu-devel] usb-storage assertions Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: hdegoede@redhat.com, Andrey Korolyov , Gerd Hoffmann , "qemu-devel@nongnu.org" On Tue, Jan 12, 2016 at 03:36:40PM +0100, Kevin Wolf wrote: > Am 12.01.2016 um 15:17 hat Gerd Hoffmann geschrieben: > > On Sa, 2016-01-09 at 20:34 +0300, Andrey Korolyov wrote: > > > Hello, > > > > > > during regular operations within linux guest with USB EHCI frontend I > > > am seeing process crashes with an assert during regular operations > > > like dpkg install: > > > > > > hw/usb/dev-storage.c:334: usb_msd_handle_reset: Assertion `s->req == > > > ((void *)0)' failed. > > > > > > This does happen when real block backend is an USB-attached device > > > itself, so we are hitting some subtle race right there, because a > > > single change of a backend to a raw file sitting on SSD has never > > > triggered this block with the linux guest (but xBSD pre-reboot flush > > > would trigger assertion from time to time in the usb_cancel_packet() > > > without regarding physical backend type: > > > > > > hw/usb/core.c:508: usb_cancel_packet: Assertion > > > `usb_packet_is_inflight(p)' failed. > > > ) > > > > > > Since the 2.2.0 which I am running is not exactly freshest one, I > > > could re-check with master today or tomorrow, but log for hw/usb/ has > > > no related commits for intentional fixes over one or another issue. > > > > Checking would be nice, but I likewise don't expect things being > > different on 2.5. > > > > Most likely these are bugs in rarely taken code paths, probably because > > the guest cancels requests and/or resets device due to timeouts (which > > in turn are triggered by slow backing storage on the host). > > > > Any chance you can rebuild qemu with DEBUG_MSD enabled (in > > hw/usb/dev-storage.c), then trigger the asserts again, so we hopefully > > get a useful trail of the events triggering the bugs? > > > > Kevin, is is possible to limit transfer rates for block devices, to > > simplify debugging stuff like this? Preferably in a way supported by > > libvirt? > > Yes. In the qemu command line, you can limit the rate with -drive > throttling.bps_total=... and similar options (you can instead throttle > based on iops instead, and you can have separate read/write limits - I > don't think you need any of these, though). > > I have never used it in libvirt, but libvirt.org seems to suggest that > it looks like this (seems to be for Xen, but you get the idea): > > > > > > > > > 10000000 > 400000 > 100000 > > Yes, that works with QEMU and will map through to the -drive I/O tuning parameters. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|