From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4AlY-0003zH-8q for qemu-devel@nongnu.org; Wed, 22 Aug 2012 09:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4AlU-0005Sg-CM for qemu-devel@nongnu.org; Wed, 22 Aug 2012 09:14:36 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:37056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4AlU-0005SU-4O for qemu-devel@nongnu.org; Wed, 22 Aug 2012 09:14:32 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Aug 2012 14:14:30 +0100 Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7MDDlFC30408920 for ; Wed, 22 Aug 2012 13:13:47 GMT Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7MDDrLs008026 for ; Wed, 22 Aug 2012 07:13:53 -0600 Date: Wed, 22 Aug 2012 14:13:48 +0100 From: Stefan Hajnoczi Message-ID: <20120822131348.GA3512@stefanha-thinkpad.localdomain> References: <1345537427-21601-1-git-send-email-mc@linux.vnet.ibm.com> <50334B51.6050900@redhat.com> <503357B2.5040901@linux.vnet.ibm.com> <50335F78.1030005@redhat.com> <5034BCD1.9020603@linux.vnet.ibm.com> <5034CBF8.3050602@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5034CBF8.3050602@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Stefan Hajnoczi , zwanp@cn.ibm.com, linuxram@us.ibm.com, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, Cong Meng On Wed, Aug 22, 2012 at 02:09:28PM +0200, Paolo Bonzini wrote: > Il 22/08/2012 13:04, Cong Meng ha scritto: > >> > >> Cong, what is the limit that the host HBA enforces (and what is the > >> HBA)? What commands see a problem? Is it fixed by using scsi-block > >> instead of scsi-generic (if you can use scsi-block at all, i.e. it's not > >> a tape or similar device)? > >> > > I don't see real problem caused by the the queue limits actually. It's a > > bug which Stefan told me. > > I'd rather avoid patching the specification if not to solve real (rather > than known-but-theoretical) problems. Benjamin Herrenschmidt reported this in problem in 2010: http://lists.gnu.org/archive/html/qemu-devel/2010-12/msg01741.html "This is a real problem in practice. IE. the USB CD-ROM on this POWER7 blade limits transfers to 0x1e000 bytes for example and the Linux "sr" driver on the guest is going to try to give me bigger requests than that if I don't start limiting them, which will cause all sort of errors." It cannot be fixed for emulated SCSI HBAs in general but it can for virtio-scsi. I/O requests will be failed with EIO if they exceed block queue limits. Take a look at block/blk-core.c:generic_make_request_checks() and blk_rq_check_limits(). Cong: Have you checked the block queue limits on your test machine and exceeded them to see what happens? Stefan