Received: from eggs.gnu.org ([2001:4830:134:3::10]:60792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZD8Pr-0003gu-Hh for qemu-devel@nongnu.org; Thu, 09 Jul 2015 05:46:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZD8Pq-0003mm-F4 for qemu-devel@nongnu.org; Thu, 09 Jul 2015 05:46:51 -0400 Date: Thu, 9 Jul 2015 10:46:42 +0100 From: Stefan Hajnoczi Message-ID: <20150709094642.GB23667@stefanha-thinkpad.redhat.com> References: <1436369462-24252-1-git-send-email-stefanha@redhat.com> <1436369462-24252-2-git-send-email-stefanha@redhat.com> <559DFAE6.1020005@kamp.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GRPZ8SYKNexpdSJ7" Content-Disposition: inline In-Reply-To: <559DFAE6.1020005@kamp.de> Subject: Re: [Qemu-devel] [PATCH for-2.5 1/4] block: add BlockLimits.max_iov field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org --GRPZ8SYKNexpdSJ7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 09, 2015 at 06:39:02AM +0200, Peter Lieven wrote: > Am 08.07.2015 um 17:30 schrieb Stefan Hajnoczi: > >The maximum number of struct iovec elements depends on the > >BlockDriverState. The raw-posix protocol has a maximum of IOV_MAX but > >others could have different values. > > > >Instead of assuming raw-posix and hardcoding IOV_MAX in several places, > >put the limit into BlockLimits. > > > >Cc: Peter Lieven > >Suggested-by: Kevin Wolf > >Signed-off-by: Stefan Hajnoczi > >--- > >Peter Lieven: I think the SCSI LUN level does not have a maximum > >scatter-gather segments constraint. That is probably only at the HBA > >level. CCed you anyway in case you think block/iscsi.c should set the > >max_iov field. >=20 > libiscsi will send the iovec array straight to readv and writev to > read/write from the TCP socket. So we need IOV_MAX here as well. Thanks, will fix in v2! > > > >Kevin: The default is now INT_MAX. This means non-raw-posix users will > >now be able to merge more requests than before. They were limited to > >IOV_MAX previously. This could expose limits in other BlockDrivers > >which we weren't aware of... >=20 > Why rise the default to INT_MAX and not leave it at IOV_MAX? > Is there any case where we except that much iovectors coming in? Both block/mirror.c and request merge have resulted in >1024 iovecs in the past. That means they can take advantage of a higher limit. On the other hand, I think you are right that the default should be IOV_MAX and only drivers with higher/lower limits should set max_iov themselves. It's safer. Stefan --GRPZ8SYKNexpdSJ7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVnkMCAAoJEJykq7OBq3PIuB8H/jmV/LPeRuZEGMuRWHukmY+2 yzEQh/QVPeUqa/X/uJZpepSAs5cq0cbKirBRlvAjUndMeihOQTBomKbk0oM8w6cT pIefVwJ8+kDJq820bgWiO1euSihTL3pDFPBHkqONBXnwFKZJsjeeU1Mjv2q8Dq3W x6Y5qAWIqTUe/6Sh1G0i7j1LeDbqKP9UFUdV+LMG00Hhc8wfwzoig5B80bjlKniu 6308mID2l4CH9xD/ty4VaLCQRJqvAEfWi9h8SXxl4MszT9unEhWJD2pTai37uXPI Ddq+azgcnYDp0ra1oMLJkpAjFRrwsJ7P4+1haywy6pGya1ppYsHxiOdzqPsBK/s= =d10b -----END PGP SIGNATURE----- --GRPZ8SYKNexpdSJ7--