From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Vs4-0001EM-TB for qemu-devel@nongnu.org; Thu, 17 Dec 2015 05:33:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9VqW-00071M-3M for qemu-devel@nongnu.org; Thu, 17 Dec 2015 05:33:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9VqV-00070e-Rw for qemu-devel@nongnu.org; Thu, 17 Dec 2015 05:31:39 -0500 References: <1450284917-10508-1-git-send-email-apyrgio@arrikto.com> <5671AA78.8050603@redhat.com> <5672768E.70101@arrikto.com> From: Paolo Bonzini Message-ID: <56728F08.7070702@redhat.com> Date: Thu, 17 Dec 2015 11:31:36 +0100 MIME-Version: 1.0 In-Reply-To: <5672768E.70101@arrikto.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Pyrgiotis Cc: qemu-devel@nongnu.org On 17/12/2015 09:47, Alex Pyrgiotis wrote: >> > Which commands have large payloads and are on the data path, for >> > scsi-block? Or is the use case just scsi-generic (e.g. tape devices?)? >> > >> > (Just trying to understand before I dive into the patches). > Sure, no problem. The commands that have large payloads and are on the > data path are the classic SCSI READ/WRITE commands. Usually, these > commands are implemented with vectored reads/writes, which utilize the > controller's scatter-gather list. > > However, when opening a "scsi-block" device with the default cache > policy (cache=writeback), QEMU fallbacks to the "scsi-generic" functions > (i.e, SG_IO ioctl requests) for reading/writing data [1]. In this case, > the data are copied in a bounce buffer, which is the issue that this > patch tackles. Right, I forgot about that. However, falling back to scsi-generic effectively means that scsi-block is always O_DIRECT/cache=none. So why not just specify cache=none? We can improve the code to print a warning if you don't. (It needs some care: iscsi never caches, independent of the cache= argument, so we don't want to warn for it. But it can be done). Paolo