From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyh3X-0004ON-2X for qemu-devel@nongnu.org; Wed, 10 Dec 2014 08:12:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xyh3O-0006PG-2t for qemu-devel@nongnu.org; Wed, 10 Dec 2014 08:11:51 -0500 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:50679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyh3N-0006P6-Sw for qemu-devel@nongnu.org; Wed, 10 Dec 2014 08:11:42 -0500 Received: by mail-wi0-f170.google.com with SMTP id bs8so13245604wib.5 for ; Wed, 10 Dec 2014 05:11:41 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54884689.7040209@redhat.com> Date: Wed, 10 Dec 2014 14:11:37 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1417424656-29714-1-git-send-email-ming.lei@canonical.com> In-Reply-To: <1417424656-29714-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v7 0/3] linux-aio: fix batch submission List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , qemu-devel@nongnu.org, Stefan Hajnoczi , Kevin Wolf On 01/12/2014 10:04, Ming Lei wrote: > The 1st patch fixes batch submission. > > The 2nd one fixes -EAGAIN for non-batch case. > > The 3rd one is a cleanup. > > This patchset is splitted from previous patchset(dataplane: optimization > and multi virtqueue support), as suggested by Stefan. I think this series needs a rewrite. Instead of removing 'node' from 'struct qemu_laiocb', each LaioQueue should actually have a list (or SIMPLEQ) of pending 'struct qemu_laiocb'. Every time you do an io_submit, you copy from the laiocb queue to the iocbs array. If it returns N, the first N elements are removed from the list. There is no need to do a memmove, the iocbs will be populated again on the next io_submit. If io_submit fails with anything but EAGAIN, just abort(). It should never happen. Every time you get a request, and the list was empty, you do an io_submit. Every time you get a bdrv_unplug and the nesting level was 1, you do an io_submit. Every time you get a completion, if the pending queue is not empty, you do an io_submit. It should be _that_ simple. Paolo