From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUkdJ-0000fg-Sf for qemu-devel@nongnu.org; Thu, 18 Sep 2014 18:57:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUkdC-0000OK-Ti for qemu-devel@nongnu.org; Thu, 18 Sep 2014 18:57:01 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:35870 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUkdC-0000KY-Ir for qemu-devel@nongnu.org; Thu, 18 Sep 2014 18:56:54 -0400 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) From: Peter Lieven In-Reply-To: <541AE887.9050607@redhat.com> Date: Fri, 19 Sep 2014 00:56:43 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1409935888-18552-1-git-send-email-pl@kamp.de> <1409935888-18552-5-git-send-email-pl@kamp.de> <541AE887.9050607@redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/4] block: avoid creating oversized writes in multiwrite_merge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com Am 18.09.2014 um 16:13 schrieb Paolo Bonzini : > Il 05/09/2014 18:51, Peter Lieven ha scritto: >> Signed-off-by: Peter Lieven >> --- >> block.c | 5 +++++ >> 1 file changed, 5 insertions(+) >>=20 >> diff --git a/block.c b/block.c >> index fa4c34b..db3f842 100644 >> --- a/block.c >> +++ b/block.c >> @@ -4554,6 +4554,11 @@ static int multiwrite_merge(BlockDriverState = *bs, BlockRequest *reqs, >> merge =3D 0; >> } >>=20 >> + if (bs->bl.max_transfer_length && reqs[outidx].nb_sectors + >> + reqs[i].nb_sectors > bs->bl.max_transfer_length) { >> + merge =3D 0; >> + } >> + >> if (merge) { >> size_t size; >> QEMUIOVector *qiov =3D g_malloc0(sizeof(*qiov)); >>=20 >=20 > So I think if we treat it just as a hint for multiwrite, we can avoid > writing code to split oversized requests. They always worked so far, = we > can certainly wait until we have a real bug fix. I would not treat this as a hint. I would use it in cases where we = definitely know an absolute hard limit for I/O request size. Otherwise the value = for bs->bl.max_transfer_length should be 0. If there comes in an oversized request we fail it as early as possible = and regarding the multi write code we avoid that it accidentally generates an = oversized request. Peter=