From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XssEa-0001cH-3Y for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:55:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XssET-0005Cp-VW for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:55:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XssET-0005B9-NO for qemu-devel@nongnu.org; Mon, 24 Nov 2014 06:55:05 -0500 Message-ID: <54731C92.9070402@redhat.com> Date: Mon, 24 Nov 2014 12:54:58 +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> <547318D0.9090400@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 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 Cc: Kevin Wolf , qemu-devel , Stefan Hajnoczi On 24/11/2014 12:49, Ming Lei wrote: > On Mon, Nov 24, 2014 at 7:38 PM, Paolo Bonzini wrote: >> >> >> 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? > > I didn't say your proposal is wrong, and this patch is correct too > without fat comment. > > The difference is only that this patch returns immediately in case > of !s->io_q.plugged after putting the req into io queue. There is no difference in the behavior of the code, right? The maintainers can decide if they want a v5 of this patch. Thanks, Paolo