From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZviB1-0002hb-Fi for qemu-devel@nongnu.org; Mon, 09 Nov 2015 03:51:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZviB0-0004Y2-Pk for qemu-devel@nongnu.org; Mon, 09 Nov 2015 03:51:47 -0500 Message-ID: <56405E84.8050205@huawei.com> Date: Mon, 9 Nov 2015 16:51:16 +0800 From: Gonglei MIME-Version: 1.0 References: <1447039178-17208-1-git-send-email-arei.gonglei@huawei.com> <56405C50.1010600@redhat.com> In-Reply-To: <56405C50.1010600@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] virtio-blk: trivial code optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: stefanha@redhat.com, qemu-block@nongnu.org On 2015/11/9 16:41, Paolo Bonzini wrote: > > > On 09/11/2015 04:19, arei.gonglei@huawei.com wrote: >> + * 1. requests are not sequential >> + * 2. merge would exceed maximum number of IOVs >> + * 3. merge would exceed maximum transfer length of backend device >> + */ >> + if (sector_num + nb_sectors != req->sector_num || >> + niov > IOV_MAX - req->qiov.niov || >> + req->qiov.size / BDRV_SECTOR_SIZE + nb_sectors > max_xfer_len) { > > Hi Gonglei, > > the third condition should also be changed to "new > max - old". > Okay, will do. :) Thanks, -Gonglei