Received: from eggs.gnu.org ([2001:4830:134:3::10]:56810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz3OS-0000kv-8X for qemu-devel@nongnu.org; Thu, 11 Dec 2014 08:03:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz3OK-0005Ya-4L for qemu-devel@nongnu.org; Thu, 11 Dec 2014 08:02:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz3OJ-0005YU-TQ for qemu-devel@nongnu.org; Thu, 11 Dec 2014 08:02:48 -0500 Date: Thu, 11 Dec 2014 14:02:37 +0100 From: Kevin Wolf Message-ID: <20141211130237.GB23351@noname.redhat.com> References: <1418223122-22481-1-git-send-email-pbonzini@redhat.com> <1418223122-22481-2-git-send-email-pbonzini@redhat.com> <20141211124956.GA23351@noname.redhat.com> <5489937C.9040904@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5489937C.9040904@redhat.com> 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: Paolo Bonzini Cc: ming.lei@canonical.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com Am 11.12.2014 um 13:52 hat Paolo Bonzini geschrieben: > > > 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. Yes. I guess I just like to be on the safe side. I would be fine with dropping requests on the floor and thereby breaking the block device in this unlikely case if proper error handling is too hard, but killing the qemu process generally makes me feel uncomfortable. > > > + 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. Oh, I see. I didn't get that this was an optimisation. Kevin