From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xsrz4-00009q-M0 for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:39:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xsryy-0007EJ-HH for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:39:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xsryy-0007EB-9S for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:39:04 -0500 Message-ID: <547318D0.9090400@redhat.com> Date: Mon, 24 Nov 2014 12:38:56 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1416828693-30767-1-git-send-email-ming.lei@canonical.com> <1416828693-30767-3-git-send-email-ming.lei@canonical.com> In-Reply-To: <1416828693-30767-3-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 2/3] linux-aio: handling -EAGAIN for !s->io_q.plugged case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , qemu-devel@nongnu.org, Stefan Hajnoczi , Kevin Wolf On 24/11/2014 12:31, Ming Lei wrote: > + /* don't submit until next completion for -EAGAIN of non plug case */ > + if (unlikely(!s->io_q.plugged)) { > + return 0; > + } > + > /* submit immediately if queue depth is above 2/3 */ > if (idx > s->io_q.size * 2 / 3) { > return ioq_submit(s); } return 0; so I fail to see why my proposal: /* This is reached in two cases: queue not plugged but io_submit * returned -EAGAIN, or queue plugged. In the latter case, start * submitting some I/O if the queue is getting too full. In the * former case, instead, wait until an I/O operation is completed. */ if (likely(idx <= s->io_q.size * 2 / 3) || unlikely(!s->io_q.plugged) { return 0; } return ioq_submit(s); was wrong. Can you explain? Paolo