From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz3EN-0005T9-4Q for qemu-devel@nongnu.org; Thu, 11 Dec 2014 07:52:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz3EH-0001Ed-0p for qemu-devel@nongnu.org; Thu, 11 Dec 2014 07:52:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz3EG-0001EP-Oh for qemu-devel@nongnu.org; Thu, 11 Dec 2014 07:52:24 -0500 Message-ID: <5489937C.9040904@redhat.com> Date: Thu, 11 Dec 2014 13:52:12 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1418223122-22481-1-git-send-email-pbonzini@redhat.com> <1418223122-22481-2-git-send-email-pbonzini@redhat.com> <20141211124956.GA23351@noname.redhat.com> In-Reply-To: <20141211124956.GA23351@noname.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] linux-aio: queue requests that cannot be submitted List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: ming.lei@canonical.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com On 11/12/2014 13:49, Kevin Wolf wrote: > > - } else { > > - i = ret; > > + abort(); > > } > > abort() doesn't feel right here. man doesn't suggest any error that can actually happen. > > + QSIMPLEQ_INSERT_TAIL(&s->io_q.pending, laiocb, next); > > + s->io_q.idx++; > > + if (s->io_q.idx == (s->io_q.plugged ? MAX_QUEUED_IO : 1)) { > > More naturally written and more obviously correct as (!s->io_q,plugged || > s->io_q.idx >= MAX_QUEUED_IO). Which happens to be what the next patch > converts it to, so I won't spend much time thinking about whether this > version is actually right. Sort of. If the queue is blocked due to -EAGAIN, I don't want to io_submit every time an operation is queued, hence the ==. The next patch adds !s->io_q.blocked, so it can use the more natural and indeed more obvious expression. Paolo